var iwjCookie=(function (){ var setCookie=function(cname, cvalue, exdays){ var d=new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires="expires="+ d.toUTCString(); document.cookie=cname + "=" + cvalue + ";" + expires + ";path=/"; }; var getCookie=function(cname){ var name=cname + "="; var decodedCookie=decodeURIComponent(document.cookie); var ca=decodedCookie.split(';'); for(var i=0; i 0){ $(this).removeClass('empty'); $(this).addClass('has-item'); }else{ $(this).removeClass('has-item'); $(this).addClass('empty'); }}); }); }}, check_filter_job_checked:function(){ $('input.iwjob-filter-jobs-cbx').each(function(){ if($(this).prop("checked")){ $(this).closest('li').addClass('checked'); }else{ $(this).closest('li').removeClass('checked'); }}); $('input.iwjob-filter-candidates-cbx').each(function(){ if($(this).prop("checked")){ $(this).closest('li').addClass('checked'); }else{ $(this).closest('li').removeClass('checked'); }}); $('input.iwjob-filter-employers-cbx').each(function(){ if($(this).prop("checked")){ $(this).closest('li').addClass('checked'); }else{ $(this).closest('li').removeClass('checked'); }}); }, sort_tax_after_ajax:function(){ iwj_filter_common.check_filter_job_checked(); if(!ul_taxs.length){ ul_taxs=$('ul[class^="iwjob-list-"]'); } if(ul_taxs.length){ ul_taxs.each(function (){ var ulSelector=$(this); var liSelector=ulSelector.find(" > li.iwj-input-checkbox"); var total_visiable=ulSelector.data('display-limit'); liSelector.sort(function(a, b){ if($(a).hasClass('checked')&&$(b).hasClass('checked')){ var res=$(b).data("order")-$(a).data("order"); return res; }else if($(a).hasClass('checked')){ return -1; }else if($(b).hasClass('checked')){ return 1; }else{ var res=$(b).data("order")-$(a).data("order"); return res; }} ); var show_more=ulSelector.find('li.show-more'); var show_less=ulSelector.find('li.show-less'); $(ulSelector).html(liSelector); $(ulSelector).append(show_more); $(ulSelector).append(show_less); ulSelector.find(" > li.iwj-input-checkbox").hide(); ulSelector.find(" > li.iwj-input-checkbox:lt("+total_visiable+")").show(); }); }}, display_filter_box:function(){ if($('li.iwj-filter-selected-item').length){ $('.iwj-filter-selected').show(); $('.iwj-clear-filter-btn').show(); }else{ $('.iwj-filter-selected').hide(); $('.iwj-clear-filter-btn').hide(); }} }; window.iwj_filter_common=iwj_filter_common; })(jQuery); jQuery(document).ready(function($){ function iwj_init_filter(){ iwj_filter_common.add_class_has_item(); iwj_filter_common.check_filter_job_checked(); } iwj_init_filter(); iwj_filter_common.display_filter_box(); }); (function ($){ var iwj_filter_job; iwj_filter_job={ filter_and_count_jobs: function (paged){ var filter_job=$('.iwj-sidebar-1'); filter_job.removeClass('open-filter'); $('.iwj-count').text('...'); $('body').addClass('iwj-loading'); var data_frm=[]; $('.job-form-filter').each(function (){ data_frm.push($(this).serializeFormJSON()); }); var data_submit={}; $.each(data_frm, function (index, value){ data_submit=$.extend(data_submit, value); }); data_submit.order=$('.sorting-job').val(); data_submit.paged=paged; data_submit.url=$('#url').val(); if($("form#iwjob-search input[name='keyword']").length){ data_submit.keyword=$("form#iwjob-search input[name='keyword']").val(); } data_submit.lang=iwj.lang; data_submit.action='iwj_filter_and_count_jobs'; if($('form[name="is_tax_page_job"]').length){ var tax_name=$('form[name="is_tax_page_job"]').find('input#is-tax-page-job').attr('name'); var tax_val=$('form[name="is_tax_page_job"]').find('input#is-tax-page-job').val(); data_submit.query_is_tax_page={}; data_submit.query_is_tax_page[tax_name]=tax_val; } data_submit._ajax_nonce=iwj.security; if(typeof window.iwj_filter_jobs_data==='function'){ data_submit=window.iwj_filter_jobs_data(data_submit); } $.ajax({ type: "POST", url: iwj.ajax_url, dataType: 'json', data: data_submit, beforeSend: function (){ if(typeof window.iwj_filter_jobs_before_send==='function'){ data_submit=window.iwj_filter_jobs_before_send(data_submit); }}, success: function (data){ window.history.pushState('', '', data.url); if($('.iwj-job-feed').length){ $('.iwj-job-feed').attr('href', data.feed_url); } if(data.status=='1'){ $("#iwajax-load").html(data.html); if($('.iwj-grid').length){ $('.iwj-grid .job-item').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); $('.iwj-grid .job-item').data('setmatchHeight', true); }}else{ $("#iwajax-load").html(''); } $('.iwj-count').text(0); $('.iwj-count').closest('li').data('order', 0); if(data.count_jobs){ $.each(data.count_jobs, function (index, value){ $('.iwj-count-' + value.idx).text(value.val); $('.iwj-count-' + value.idx).closest('li').data('order', value.val); }); } iwj_filter_common.sort_tax_after_ajax(); if(typeof window.iwj_filter_jobs_success==='function'){ data_submit=window.iwj_filter_jobs_success(data, data_submit); } $('body').removeClass('iwj-loading'); $('html, body').animate({scrollTop: 0}, 'slow'); }}); }}; window.iwj_filter_job=iwj_filter_job; })(jQuery); jQuery(document).ready(function ($){ $('body').delegate('button.clear-filter-job', 'click', function (e){ e.preventDefault(); if(typeof window.iwj_before_remove_all_filter_callback=='object'){ for (var key in window.iwj_before_remove_all_filter_callback){ if(!window.iwj_before_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('job'); }} } $('li.iwj-filter-selected-item').remove(); $('.iwjob-filter-jobs-cbx').prop('checked', false); $('form[name="iwjob-other-filters"] input').val(''); iwj_filter_job.filter_and_count_jobs(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_remove_all_filter_callback=='object'){ for (var key in window.iwj_after_remove_all_filter_callback){ if(!window.iwj_after_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('job'); }} }}); $('body').on('click', '.iwj-input-checkbox a', function (){ var input=$(this).find('.iwjob-filter-jobs-cbx'); var value=input.val(); var getname=input.attr("name"); var items=$('.sidebar-jobs-item').find('.iwjob-filter-jobs-cbx-' + value); if(input.prop("checked")){ items.prop("checked", false); }else{ items.prop("checked", true); } items.each(function (i, e){ if(i==0){ if(typeof window.iwj_before_filter_callback=='object'){ for (var key in window.iwj_before_filter_callback){ if(!window.iwj_before_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'job'); }} } var id_js='.iwj-filter-selected-item-' + value; if(input.prop("checked")){ input.closest('li').addClass('checked'); var id_html='iwj-filter-selected-item-' + value; if(!$('.iwj-filter-selected').find(id_js).length){ if($('.iwj-filter-selected').find('ul').length){ var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); }else{ $('.iwj-filter-selected').append(''); var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); } if(getname==="iwj_cat[]"){ var span=''; $('.find-jobs-results').append(span); }} }else{ input.closest('li').removeClass('checked'); if($('.iwj-filter-selected').find(id_js).length){ $('.iwj-filter-selected').find(id_js).remove(); } if(getname==="iwj_cat[]"){ $('.find-jobs-results').find(id_js).remove(); }} iwj_filter_job.filter_and_count_jobs(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_filter_callback=='object'){ for (var key in window.iwj_after_filter_callback){ if(!window.iwj_after_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'job'); }} }} }); }); $('body').delegate('.sorting-job', 'change', function (){ iwj_filter_job.filter_and_count_jobs(1); }); }); (function ($){ var iwj_filter_candidate; iwj_filter_candidate={ filter_and_count_candidates: function (paged, callback){ var filter_job=$('.iwj-sidebar-1'); filter_job.removeClass('open-filter'); $('.iwj-count').text('...'); $('body').addClass('iwj-loading'); var data_frm=[]; $('.candidate-form-filter').each(function (){ data_frm.push($(this).serializeFormJSON()); }); var data_submit={}; $.each(data_frm, function (index, value){ data_submit=$.extend(data_submit, value); }); data_submit.order=$('.sorting-candidates').val(); data_submit.paged=paged; data_submit.url=$('#url').val(); data_submit.keyword=$("form#iwjob-search input[name='keyword']").val(); data_submit.action='iwj_filter_and_count_candidates'; data_submit.mode=iwjCookie.getCookie('job-archive-view'); data_submit._ajax_nonce=iwj.security; $.ajax({ type: "POST", url: iwj.ajax_url, dataType: 'json', data: data_submit, success: function (data){ window.history.pushState('', '', data.url); if($('.iwj-candidate-feed').length){ $('.iwj-candidate-feed').attr('href', data.feed_url); } if(data.status=='1'){ $("#iwajax-load-candidates").html(data.html); }else{ $("#iwajax-load-candidates").html(''); } $.fn.matchHeight._apply($('.iwj-candidates.iwj-grid .candidate-item'), { byRow: true, property: 'height', target: null, remove: false }); $('.iwj-count').text(0); $('.iwj-count').closest('li').data('order', 0); if(data.count_candidates){ $.each(data.count_candidates, function (index, value){ $('.iwj-count-' + value.idx).text(value.val); $('.iwj-count-' + value.idx).closest('li').data('order', value.val); }); } iwj_filter_common.sort_tax_after_ajax(); if(typeof window.callback==='function'){ window.callback(data); } $('body').removeClass('iwj-loading'); $('html, body').animate({scrollTop: 0}, 'slow'); }}); }}; window.iwj_filter_candidate=iwj_filter_candidate; })(jQuery); jQuery(document).ready(function ($){ $('body').on('click', '.clear-filter-candidate', function (e){ e.preventDefault(); if(typeof window.iwj_before_remove_all_filter_callback=='object'){ for (var key in window.iwj_before_remove_all_filter_callback){ if(!window.iwj_before_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('candidate'); }} } $('li.iwj-filter-selected-item').remove(); $('.iwjob-filter-candidates-cbx').prop('checked', false); iwj_filter_candidate.filter_and_count_candidates(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_remove_all_filter_callback=='object'){ for (var key in window.iwj_after_remove_all_filter_callback){ if(!window.iwj_after_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('candidate'); }} }}); $('body').on('click', '.iwj-input-checkbox a', function (){ var input=$(this).find('.iwjob-filter-candidates-cbx'); if(input.length){ var value=input.val(); if(input.prop("checked")){ input.prop("checked", false); }else{ input.prop("checked", true); } if(typeof window.iwj_before_filter_callback=='object'){ for (var key in window.iwj_before_filter_callback){ if(!window.iwj_before_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'canidate'); }} } var id_js='.iwj-filter-selected-item-' + value; if(input.prop("checked")){ input.closest('li').addClass('checked'); var id_html='iwj-filter-selected-item-' + value; if(!$('.iwj-filter-selected').find(id_js).length){ if($('.iwj-filter-selected').find('ul').length){ var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); }else{ $('.iwj-filter-selected').append(''); var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); }} }else{ input.closest('li').removeClass('checked'); if($('.iwj-filter-selected').find(id_js).length){ $('.iwj-filter-selected').find(id_js).remove(); }} iwj_filter_candidate.filter_and_count_candidates(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_filter_callback=='object'){ for (var key in window.iwj_after_filter_callback){ if(!window.iwj_after_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'candidate'); }} }} }); $('body').delegate('.sorting-candidates', 'change', function (){ iwj_filter_candidate.filter_and_count_candidates(1); }); }); (function ($){ var iwj_filter_employer; iwj_filter_employer={ filter_and_count_employers: function (paged, callback){ var filter_job=$('.iwj-sidebar-1'); filter_job.removeClass('open-filter'); $('.iwj-count').text('...'); $('body').addClass('iwj-loading'); var data_frm=[]; $('.employer-form-filter').each(function (){ data_frm.push($(this).serializeFormJSON()); }); var data_submit={}; $.each(data_frm, function (index, value){ data_submit=$.extend(data_submit, value); }); data_submit.order=$('.sorting-employers').val(); data_submit.paged=paged; data_submit.url=$('#url').val(); data_submit.keyword=$("form#iwjob-search input[name='keyword']").val(); data_submit.action='iwj_filter_and_count_employers'; data_submit.mode=iwjCookie.getCookie('employer-archive-view'); if($('input[name="iwj-alpha-filter"]').length){ data_submit.alpha=$('input[name="iwj-alpha-filter"]').val(); }else{ data_submit.alpha=''; } data_submit._ajax_nonce=iwj.security; $.ajax({ type: "POST", url: iwj.ajax_url, dataType: 'json', data: data_submit, success: function (data){ window.history.pushState('', '', data.url); if($('.iwj-employer-feed').length){ $('.iwj-employer-feed').attr('href', data.feed_url); } if(data.status=='1'){ $("#iwajax-load-employers").html(data.html); }else{ $("#iwajax-load-employers").html(''); } $.fn.matchHeight._apply($('.iwj-grid .iwj-employer-item'), { byRow: true, property: 'height', target: null, remove: false }); $('.iwj-count').text(0); $('.iwj-count').closest('li').data('order', 0); if(data.count_employers){ $.each(data.count_employers, function (index, value){ $('.iwj-count-' + value.idx).text(value.val); $('.iwj-count-' + value.idx).closest('li').data('order', value.val); }); } iwj_filter_common.sort_tax_after_ajax(); if(typeof window.callback==='function'){ window.callback(data); } $('body').removeClass('iwj-loading'); $('html, body').animate({ scrollTop: 0 }, 'slow'); }}); }}; window.iwj_filter_employer=iwj_filter_employer; })(jQuery); jQuery(document).ready(function ($){ $('body').delegate('.clear-filter-employer', 'click', function (e){ e.preventDefault(); if(typeof window.iwj_before_remove_all_filter_callback=='object'){ for (var key in window.iwj_before_remove_all_filter_callback){ if(!window.iwj_before_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('employer'); }} } $('li.iwj-filter-selected-item').remove(); $('.iwj-alpha').removeClass('active'); $('.iwj-alpha-').addClass('active'); if($('input[name="iwj-alpha-filter"]').length){ $('input[name="iwj-alpha-filter"]').val(''); } $('.iwjob-filter-employers-cbx').prop('checked', false); iwj_filter_employer.filter_and_count_employers(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_remove_all_filter_callback=='object'){ for (var key in window.iwj_after_remove_all_filter_callback){ if(!window.iwj_after_remove_all_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_remove_all_filter_callback[key]; if(typeof callback_function=='function'){ callback_function('employer'); }} }}); $('body').on('click', '.iwj-input-checkbox a', function (){ var input=$(this).find('.iwjob-filter-employers-cbx'); if(input.length){ var value=input.val(); if(input.prop("checked")){ input.prop("checked", false); }else{ input.prop("checked", true); } if(typeof window.iwj_before_filter_callback=='object'){ for (var key in window.iwj_before_filter_callback){ if(!window.iwj_before_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'employer'); }} } var id_js='.iwj-filter-selected-item-' + value; if(input.prop("checked")){ input.closest('li').addClass('checked'); var id_html='iwj-filter-selected-item-' + value; if(!$('.iwj-filter-selected').find(id_js).length){ if($('.iwj-filter-selected').find('ul').length){ var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); }else{ $('.iwj-filter-selected').append(''); var li='
  • '; $('.iwj-filter-selected').find('ul').append(li); }} }else{ input.closest('li').removeClass('checked'); if($('.iwj-filter-selected').find(id_js).length){ $('.iwj-filter-selected').find(id_js).remove(); }} iwj_filter_employer.filter_and_count_employers(1); iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_filter_callback=='object'){ for (var key in window.iwj_after_filter_callback){ if(!window.iwj_after_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(value, 'employer'); }} }} }); $('body').delegate('.sorting-employers', 'change', function (){ iwj_filter_employer.filter_and_count_employers(1); }); }); jQuery(document).ready(function($){ $('body').delegate('.show-more a', 'click', function(e){ e.preventDefault(); var ulSelector=$(this).closest('ul'); $('li.show-more', ulSelector).hide(); var limit=0; var cfg_limit_show_more_selector=$(this).closest('form').find('input[name="limit_show_more"]'); if(cfg_limit_show_more_selector.length){ limit=parseInt(cfg_limit_show_more_selector.val()); } if(limit > 0){ $('> li.iwj-input-checkbox:lt('+limit+')', ulSelector).show(); }else{ $('> li.iwj-input-checkbox', ulSelector).show(); } $('li.show-less', ulSelector).show(); }); $('body').delegate('.show-less a', 'click', function(e){ e.preventDefault(); var ul_selector=$(this).closest('ul'); $('li.show-less', ul_selector).hide(); var limit=0; var input_limit_selector=ul_selector.closest('form').find('input[name="limit"]'); if(input_limit_selector.length){ var limit=parseInt(input_limit_selector.val()); } if(limit > 0){ var li_show='> li.iwj-input-checkbox:lt('+limit+')'; }else{ var li_show='> li.iwj-input-checkbox'; } $('> li.iwj-input-checkbox', ul_selector).hide(); $(li_show, ul_selector).show(); $('li.show-more', ul_selector).show(); }); }); jQuery(document).ready(function($){ $('body').delegate('.iwjob-ajax-pagination li a', 'click', function(e){ e.preventDefault(); $('.iwjob-ajax-pagination li').removeClass('active'); $(this).closest('li').addClass('active'); var paged=$(this).closest('li').data('paged'); var pag=$(this).closest('.w-pagination'); pag.find('input[name="page_number"]').val(paged); if(pag.hasClass('ajax-candidate-pagination')){ iwj_filter_candidate.filter_and_count_candidates(paged); }else if(pag.hasClass('ajax-employer-pagination')){ iwj_filter_employer.filter_and_count_employers(paged); }else{ iwj_filter_job.filter_and_count_jobs(paged); }}); }); jQuery(document).ready(function($){ $("form#iwjob-search input[name='keyword']").on('keyup keypress', function(e){ var keyCode=e.keyCode||e.which; if(keyCode===13){ e.preventDefault(); var type=$(this).closest('form').find('input[name="type"]').val(); if(type=='candidate'){ iwj_filter_candidate.filter_and_count_candidates(1); }else if(type=='employer'){ iwj_filter_employer.filter_and_count_employers(1); }else{ iwj_filter_job.filter_and_count_jobs(1); } return false; }}); $('.btn-iwjob-search').on('click', function(e){ e.preventDefault; var type=$(this).closest('form').find('input[name="type"]').val(); if(type=='candidate'){ iwj_filter_candidate.filter_and_count_candidates(1); }else if(type=='employer'){ iwj_filter_employer.filter_and_count_employers(1); }else{ iwj_filter_job.filter_and_count_jobs(1); }}); }); jQuery(document).ready(function($){ function iwj_send_queue_email(){ var data_submit={'action': 'iwj_send_queue_email'}; data_submit._ajax_nonce=iwj.security; $.ajax({ type: "POST", url: iwj.ajax_url, dataType:'json', data: data_submit, success: function(data){ }}); } if(iwj&&parseInt(iwj.total_email_queue) > 0){ setTimeout(iwj_send_queue_email(), 1000); }}); jQuery(document).ready(function($){ $('a.iwj-alpha-filter').on('click', function(e){ e.preventDefault(); var filter=$(this).data('filter'); $('.iwj-alpha').removeClass('active'); $(this).closest('.iwj-alpha').addClass('active'); if($('input[name="iwj-alpha-filter"]').length){ $('input[name="iwj-alpha-filter"]').val(filter); } iwj_filter_employer.filter_and_count_employers(1); }); }); jQuery(document).ready(function($){ function init_mode_view(){ var displayMode=iwjCookie.getCookie('job-archive-view'); if(displayMode=='grid'){ change_mode_view('grid'); }} window.iwj_change_list_view_callback=function(data){ $('#iwajax-load-employers > div').removeClass('iwj-grid').addClass('iwj-listing'); $('#iwajax-load-candidates > div').removeClass('iwj-grid').addClass('iwj-listing'); }; window.iwj_change_grid_view_callback=function(data){ $('#iwajax-load-employers > div').removeClass('iwj-listing').addClass('iwj-grid'); $('#iwajax-load-employers > div').removeClass('iwj-listing').addClass('iwj-grid'); }; function change_mode_view(change_mode){ if(change_mode=='list'){ $('a.layout-grid').closest('li').removeClass('active'); $('a.layout-list').closest('li').addClass('active'); iwjCookie.setCookie('job-archive-view', 'list', 1); var displayMode=iwjCookie.getCookie('job-archive-view'); if($('#iwajax-load').length){ $('#iwajax-load > div').removeClass('iwj-grid').addClass('iwj-listing'); } if($('#iwajax-load-candidates').length){ if($('.ajax-candidate-pagination').length){ var current_page=$('.ajax-candidate-pagination').find('input[name="page_number"]').val(); }else{ var current_page=1; } iwjCookie.setCookie('candidate-archive-view', 'list', 1); displayMode=iwjCookie.getCookie('candidate-archive-view'); iwj_filter_candidate.filter_and_count_candidates(current_page, iwj_change_list_view_callback); } if($('#iwajax-load-employers').length){ if($('.ajax-employer-pagination').length){ var current_page=$('.ajax-employer-pagination').find('input[name="page_number"]').val(); }else{ var current_page=1; } iwjCookie.setCookie('employer-archive-view', 'list', 1); displayMode=iwjCookie.getCookie('employer-archive-view'); iwj_filter_employer.filter_and_count_employers(current_page, iwj_change_list_view_callback); }}else{ $('a.layout-list').closest('li').removeClass('active'); $('a.layout-grid').closest('li').addClass('active'); iwjCookie.setCookie('job-archive-view', 'grid', 1); var displayMode=iwjCookie.getCookie('job-archive-view'); if($('#iwajax-load').length){ $('#iwajax-load > div').removeClass('iwj-listing').addClass('iwj-grid'); if(!$('.iwj-grid .job-item').data('setmatchHeight')){ $('.iwj-grid .job-item').matchHeight({ byRow: true, property: 'height', target: null, remove: false }); $('.iwj-grid .job-item').data('setmatchHeight', true); }} if($('#iwajax-load-candidates').length){ if($('.ajax-candidate-pagination').length){ var current_page=$('.ajax-candidate-pagination').find('input[name="page_number"]').val(); }else{ var current_page=1; } iwjCookie.setCookie('candidate-archive-view', 'grid', 1); displayMode=iwjCookie.getCookie('candidate-archive-view'); iwj_filter_candidate.filter_and_count_candidates(current_page, iwj_change_grid_view_callback); } if($('#iwajax-load-employers').length){ if($('.ajax-employer-pagination').length){ var current_page=$('.ajax-employer-pagination').find('input[name="page_number"]').val(); }else{ var current_page=1; } iwjCookie.setCookie('employer-archive-view', 'grid', 1); displayMode=iwjCookie.getCookie('employer-archive-view'); iwj_filter_employer.filter_and_count_employers(current_page, iwj_change_grid_view_callback); }} } setTimeout(function (){ $('body').delegate('a.layout-list', 'click', function(e){ e.preventDefault(); change_mode_view('list'); }); }, 200); setTimeout(function (){ $('body').delegate('a.layout-grid', 'click', function(e){ e.preventDefault(); change_mode_view('grid'); }); }, 200); }); jQuery(document).ready(function ($){ $('body').on('click', 'li.iwj-filter-selected-item', function (){ var target=$(this); var term_id=target.data('termid'); var type=target.data('type'); var search_type=target.data('search_type'); target.remove(); if(typeof window.iwj_before_remove_filter_callback=='object'){ for (var key in window.iwj_before_remove_filter_callback){ if(!window.iwj_before_remove_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_before_remove_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(term_id, type); }} } if(search_type){ if(search_type=='keyword'){ $('form[name="iwjob-other-filters"] input[name="keyword"]').val(''); }else if(search_type=='radius'){ $('form[name="iwjob-other-filters"] input[name="current_lat"]').val(''); $('form[name="iwjob-other-filters"] input[name="current_lng"]').val(''); $('form[name="iwjob-other-filters"] input[name="current_address"]').val(''); $('form[name="iwjob-other-filters"] input[name="current_radius"]').val(''); } iwj_filter_job.filter_and_count_jobs(1); }else{ if(type=='candidate'){ $('.iwjob-filter-candidates-cbx-' + term_id).first().closest('a').click(); }else if(type=='employer'){ $('.iwjob-filter-employers-cbx-' + term_id).first().closest('a').click(); }else{ $('.iwjob-filter-jobs-cbx-' + term_id).first().closest('a').click(); }} iwj_filter_common.display_filter_box(); if(typeof window.iwj_after_remove_filter_callback=='object'){ for (var key in window.iwj_after_remove_filter_callback){ if(!window.iwj_after_remove_filter_callback.hasOwnProperty(key)) continue; var callback_function=window.iwj_after_remove_filter_callback[key]; if(typeof callback_function=='function'){ callback_function(term_id, type); }} }}); }); ;(function(factory){ 'use strict'; if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof module!=='undefined'&&module.exports){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }})(function($){ var _previousResizeWidth=-1, _updateTimeout=-1; var _parse=function(value){ return parseFloat(value)||0; }; var _rows=function(elements){ var tolerance=1, $elements=$(elements), lastTop=null, rows=[]; $elements.each(function(){ var $that=$(this), top=$that.offset().top - _parse($that.css('margin-top')), lastRow=rows.length > 0 ? rows[rows.length - 1]:null; if(lastRow===null){ rows.push($that); }else{ if(Math.floor(Math.abs(lastTop - top)) <=tolerance){ rows[rows.length - 1]=lastRow.add($that); }else{ rows.push($that); }} lastTop=top; }); return rows; }; var _parseOptions=function(options){ var opts={ byRow: true, property: 'height', target: null, remove: false }; if(typeof options==='object'){ return $.extend(opts, options); } if(typeof options==='boolean'){ opts.byRow=options; }else if(options==='remove'){ opts.remove=true; } return opts; }; var matchHeight=$.fn.matchHeight=function(options){ var opts=_parseOptions(options); if(opts.remove){ var that=this; this.css(opts.property, ''); $.each(matchHeight._groups, function(key, group){ group.elements=group.elements.not(that); }); return this; } if(this.length <=1&&!opts.target){ return this; } matchHeight._groups.push({ elements: this, options: opts }); matchHeight._apply(this, opts); return this; }; matchHeight.version='master'; matchHeight._groups=[]; matchHeight._throttle=80; matchHeight._maintainScroll=false; matchHeight._beforeUpdate=null; matchHeight._afterUpdate=null; matchHeight._rows=_rows; matchHeight._parse=_parse; matchHeight._parseOptions=_parseOptions; matchHeight._apply=function(elements, options){ var opts=_parseOptions(options), $elements=$(elements), rows=[$elements]; var scrollTop=$(window).scrollTop(), htmlHeight=$('html').outerHeight(true); var $hiddenParents=$elements.parents().filter(':hidden'); $hiddenParents.each(function(){ var $that=$(this); $that.data('style-cache', $that.attr('style')); }); $hiddenParents.css('display', 'block'); if(opts.byRow&&!opts.target){ $elements.each(function(){ var $that=$(this), display=$that.css('display'); if(display!=='inline-block'&&display!=='flex'&&display!=='inline-flex'){ display='block'; } $that.data('style-cache', $that.attr('style')); $that.css({ 'display': display, 'padding-top': '0', 'padding-bottom': '0', 'margin-top': '0', 'margin-bottom': '0', 'border-top-width': '0', 'border-bottom-width': '0', 'height': '100px', 'overflow': 'hidden' }); }); rows=_rows($elements); $elements.each(function(){ var $that=$(this); $that.attr('style', $that.data('style-cache')||''); }); } $.each(rows, function(key, row){ var $row=$(row), targetHeight=0; if(!opts.target){ if(opts.byRow&&$row.length <=1){ $row.css(opts.property, ''); return; } $row.each(function(){ var $that=$(this), style=$that.attr('style'), display=$that.css('display'); if(display!=='inline-block'&&display!=='flex'&&display!=='inline-flex'){ display='block'; } var css={ 'display': display }; css[opts.property]=''; $that.css(css); if($that.outerHeight(false) > targetHeight){ targetHeight=$that.outerHeight(false); } if(style){ $that.attr('style', style); }else{ $that.css('display', ''); }}); }else{ targetHeight=opts.target.outerHeight(false); } $row.each(function(){ var $that=$(this), verticalPadding=0; if(opts.target&&$that.is(opts.target)){ return; } if($that.css('box-sizing')!=='border-box'){ verticalPadding +=_parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); verticalPadding +=_parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); } $that.css(opts.property, (targetHeight - verticalPadding) + 'px'); }); }); $hiddenParents.each(function(){ var $that=$(this); $that.attr('style', $that.data('style-cache')||null); }); if(matchHeight._maintainScroll){ $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true)); } return this; }; matchHeight._applyDataApi=function(){ var groups={}; $('[data-match-height], [data-mh]').each(function(){ var $this=$(this), groupId=$this.attr('data-mh')||$this.attr('data-match-height'); if(groupId in groups){ groups[groupId]=groups[groupId].add($this); }else{ groups[groupId]=$this; }}); $.each(groups, function(){ this.matchHeight(true); }); }; var _update=function(event){ if(matchHeight._beforeUpdate){ matchHeight._beforeUpdate(event, matchHeight._groups); } $.each(matchHeight._groups, function(){ matchHeight._apply(this.elements, this.options); }); if(matchHeight._afterUpdate){ matchHeight._afterUpdate(event, matchHeight._groups); }}; matchHeight._update=function(throttle, event){ if(event&&event.type==='resize'){ var windowWidth=$(window).width(); if(windowWidth===_previousResizeWidth){ return; } _previousResizeWidth=windowWidth; } if(!throttle){ _update(event); }else if(_updateTimeout===-1){ _updateTimeout=setTimeout(function(){ _update(event); _updateTimeout=-1; }, matchHeight._throttle); }}; $(matchHeight._applyDataApi); var on=$.fn.on ? 'on':'bind'; $(window)[on]('load', function(event){ matchHeight._update(false, event); }); $(window)[on]('resize orientationchange', function(event){ matchHeight._update(true, event); }); }); (function (window, document, $, undefined){ "use strict"; var H=$("html"), W=$(window), D=$(document), F=$.fancybox=function (){ F.open.apply(this, arguments); }, IE=navigator.userAgent.match(/msie/i), didUpdate=null, isTouch=document.createTouch!==undefined, isQuery=function(obj){ return obj&&obj.hasOwnProperty&&obj instanceof $; }, isString=function(str){ return str&&$.type(str)==="string"; }, isPercentage=function(str){ return isString(str)&&str.indexOf('%') > 0; }, isScrollable=function(el){ return (el&&!(el.style.overflow&&el.style.overflow==='hidden')&&((el.clientWidth&&el.scrollWidth > el.clientWidth)||(el.clientHeight&&el.scrollHeight > el.clientHeight))); }, getScalar=function(orig, dim){ var value=parseInt(orig, 10)||0; if(dim&&isPercentage(orig)){ value=F.getViewport()[ dim ] / 100 * value; } return Math.ceil(value); }, getValue=function(value, dim){ return getScalar(value, dim) + 'px'; }; $.extend(F, { version: '2.1.5', defaults: { padding:15, margin:20, width:800, height:600, minWidth:100, minHeight:100, maxWidth:9999, maxHeight:9999, pixelRatio: 1, autoSize:true, autoHeight:false, autoWidth:false, autoResize:true, autoCenter:!isTouch, fitToView:true, aspectRatio:false, topRatio:0.5, leftRatio:0.5, scrolling:'auto', // 'auto', 'yes' or 'no' wrapCSS:'', arrows:true, closeBtn:true, closeClick:false, nextClick:false, mouseWheel:true, autoPlay:false, playSpeed:3000, preload:3, modal:false, loop:true, ajax:{ dataType:'html', headers:{ 'X-fancyBox': true }}, iframe:{ scrolling:'auto', preload:true }, swf:{ wmode: 'transparent', allowfullscreen:'true', allowscriptaccess:'always' }, keys:{ next:{ 13:'left', 34:'up', 39:'left', 40:'up' }, prev:{ 8:'right', 33:'down', 37:'right', 38:'down' }, close:[27], play:[32], toggle:[70] }, direction:{ next:'left', prev:'right' }, scrollOutside:true, index:0, type:null, href:null, content:null, title:null, tpl: { wrap:'
    ', image:'', iframe:'', error:'

    The requested content cannot be loaded.
    Please try again later.

    ', closeBtn:'', next:'', prev:'' }, openEffect:'fade', // 'elastic', 'fade' or 'none' openSpeed:250, openEasing:'swing', openOpacity:true, openMethod:'zoomIn', closeEffect:'fade', // 'elastic', 'fade' or 'none' closeSpeed:250, closeEasing:'swing', closeOpacity:true, closeMethod:'zoomOut', nextEffect:'elastic', // 'elastic', 'fade' or 'none' nextSpeed:250, nextEasing:'swing', nextMethod:'changeIn', prevEffect:'elastic', // 'elastic', 'fade' or 'none' prevSpeed:250, prevEasing:'swing', prevMethod:'changeOut', helpers:{ overlay:true, title:true }, onCancel:$.noop, beforeLoad:$.noop, afterLoad:$.noop, beforeShow:$.noop, afterShow:$.noop, beforeChange:$.noop, beforeClose:$.noop, afterClose:$.noop }, group:{}, opts:{}, previous:null, coming:null, current:null, isActive:false, isOpen:false, isOpened:false, wrap:null, skin:null, outer:null, inner:null, player:{ timer:null, isActive:false }, ajaxLoad:null, imgPreload:null, transitions:{}, helpers:{}, open: function (group, opts){ if(!group){ return; } if(!$.isPlainObject(opts)){ opts={};} if(false===F.close(true)){ return; } if(!$.isArray(group)){ group=isQuery(group) ? $(group).get():[group]; } $.each(group, function(i, element){ var obj={}, href, title, content, type, rez, hrefParts, selector; if($.type(element)==="object"){ if(element.nodeType){ element=$(element); } if(isQuery(element)){ obj={ href:element.data('fancybox-href')||element.attr('href'), title:element.data('fancybox-title')||element.attr('title'), isDom:true, element:element }; if($.metadata){ $.extend(true, obj, element.metadata()); }}else{ obj=element; }} href=opts.href||obj.href||(isString(element) ? element:null); title=opts.title!==undefined ? opts.title:obj.title||''; content=opts.content||obj.content; type=content ? 'html':(opts.type||obj.type); if(!type&&obj.isDom){ type=element.data('fancybox-type'); if(!type){ rez=element.prop('class').match(/fancybox\.(\w+)/); type=rez ? rez[1]:null; }} if(isString(href)){ if(!type){ if(F.isImage(href)){ type='image'; }else if(F.isSWF(href)){ type='swf'; }else if(href.charAt(0)==='#'){ type='inline'; }else if(isString(element)){ type='html'; content=element; }} if(type==='ajax'){ hrefParts=href.split(/\s+/, 2); href=hrefParts.shift(); selector=hrefParts.shift(); }} if(!content){ if(type==='inline'){ if(href){ content=$(isString(href) ? href.replace(/.*(?=#[^\s]+$)/, ''):href); }else if(obj.isDom){ content=element; }}else if(type==='html'){ content=href; }else if(!type&&!href&&obj.isDom){ type='inline'; content=element; }} $.extend(obj, { href:href, type:type, content:content, title:title, selector:selector }); group[ i ]=obj; }); F.opts=$.extend(true, {}, F.defaults, opts); if(opts.keys!==undefined){ F.opts.keys=opts.keys ? $.extend({}, F.defaults.keys, opts.keys):false; } F.group=group; return F._start(F.opts.index); }, cancel: function (){ var coming=F.coming; if(!coming||false===F.trigger('onCancel')){ return; } F.hideLoading(); if(F.ajaxLoad){ F.ajaxLoad.abort(); } F.ajaxLoad=null; if(F.imgPreload){ F.imgPreload.onload=F.imgPreload.onerror=null; } if(coming.wrap){ coming.wrap.stop(true, true).trigger('onReset').remove(); } F.coming=null; if(!F.current){ F._afterZoomOut(coming); }}, close: function (event){ F.cancel(); if(false===F.trigger('beforeClose')){ return; } F.unbindEvents(); if(!F.isActive){ return; } if(!F.isOpen||event===true){ $('.fancybox-wrap').stop(true).trigger('onReset').remove(); F._afterZoomOut(); }else{ F.isOpen=F.isOpened=false; F.isClosing=true; $('.fancybox-item, .fancybox-nav').remove(); F.wrap.stop(true, true).removeClass('fancybox-opened'); F.transitions[ F.current.closeMethod ](); }}, play: function(action){ var clear=function (){ clearTimeout(F.player.timer); }, set=function (){ clear(); if(F.current&&F.player.isActive){ F.player.timer=setTimeout(F.next, F.current.playSpeed); }}, stop=function (){ clear(); D.unbind('.player'); F.player.isActive=false; F.trigger('onPlayEnd'); }, start=function (){ if(F.current&&(F.current.loop||F.current.index < F.group.length - 1)){ F.player.isActive=true; D.bind({ 'onCancel.player beforeClose.player':stop, 'onUpdate.player':set, 'beforeLoad.player':clear }); set(); F.trigger('onPlayStart'); }}; if(action===true||(!F.player.isActive&&action!==false)){ start(); }else{ stop(); }}, next: function(direction){ var current=F.current; if(current){ if(!isString(direction)){ direction=current.direction.next; } F.jumpto(current.index + 1, direction, 'next'); }}, prev: function(direction){ var current=F.current; if(current){ if(!isString(direction)){ direction=current.direction.prev; } F.jumpto(current.index - 1, direction, 'prev'); }}, jumpto: function(index, direction, router){ var current=F.current; if(!current){ return; } index=getScalar(index); F.direction=direction||current.direction[ (index >=current.index ? 'next':'prev') ]; F.router=router||'jumpto'; if(current.loop){ if(index < 0){ index=current.group.length + (index % current.group.length); } index=index % current.group.length; } if(current.group[ index ]!==undefined){ F.cancel(); F._start(index); }}, reposition: function (e, onlyAbsolute){ var current=F.current, wrap=current ? current.wrap:null, pos; if(wrap){ pos=F._getPosition(onlyAbsolute); if(e&&e.type==='scroll'){ delete pos.position; wrap.stop(true, true).animate(pos, 200); }else{ wrap.css(pos); current.pos=$.extend({}, current.dim, pos); }} }, update: function (e){ var type=(e&&e.type), anyway = !type||type==='orientationchange'; if(anyway){ clearTimeout(didUpdate); didUpdate=null; } if(!F.isOpen||didUpdate){ return; } didUpdate=setTimeout(function(){ var current=F.current; if(!current||F.isClosing){ return; } F.wrap.removeClass('fancybox-tmp'); if(anyway||type==='load'||(type==='resize'&¤t.autoResize)){ F._setDimension(); } if(!(type==='scroll'&¤t.canShrink)){ F.reposition(e); } F.trigger('onUpdate'); didUpdate=null; }, (anyway&&!isTouch ? 0:300)); }, toggle: function(action){ if(F.isOpen){ F.current.fitToView=$.type(action)==="boolean" ? action:!F.current.fitToView; if(isTouch){ F.wrap.removeAttr('style').addClass('fancybox-tmp'); F.trigger('onUpdate'); } F.update(); }}, hideLoading: function (){ D.unbind('.loading'); $('#fancybox-loading').remove(); }, showLoading: function (){ var el, viewport; F.hideLoading(); el=$('
    ').click(F.cancel).appendTo('body'); D.bind('keydown.loading', function(e){ if((e.which||e.keyCode)===27){ e.preventDefault(); F.cancel(); }}); if(!F.defaults.fixed){ viewport=F.getViewport(); el.css({ position:'absolute', top:(viewport.h * 0.5) + viewport.y, left:(viewport.w * 0.5) + viewport.x }); }}, getViewport: function (){ var locked=(F.current&&F.current.locked)||false, rez={ x: W.scrollLeft(), y: W.scrollTop() }; if(locked){ rez.w=locked[0].clientWidth; rez.h=locked[0].clientHeight; }else{ rez.w=isTouch&&window.innerWidth ? window.innerWidth:W.width(); rez.h=isTouch&&window.innerHeight ? window.innerHeight:W.height(); } return rez; }, unbindEvents: function (){ if(F.wrap&&isQuery(F.wrap)){ F.wrap.unbind('.fb'); } D.unbind('.fb'); W.unbind('.fb'); }, bindEvents: function (){ var current=F.current, keys; if(!current){ return; } W.bind('orientationchange.fb' + (isTouch ? '':' resize.fb') + (current.autoCenter&&!current.locked ? ' scroll.fb':''), F.update); keys=current.keys; if(keys){ D.bind('keydown.fb', function (e){ var code=e.which||e.keyCode, target=e.target||e.srcElement; if(code===27&&F.coming){ return false; } if(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey&&!(target&&(target.type||$(target).is('[contenteditable]')))){ $.each(keys, function(i, val){ if(current.group.length > 1&&val[ code ]!==undefined){ F[ i ](val[ code ]); e.preventDefault(); return false; } if($.inArray(code, val) > -1){ F[ i ] (); e.preventDefault(); return false; }}); }}); } if($.fn.mousewheel&¤t.mouseWheel){ F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY){ var target=e.target||null, parent=$(target), canScroll=false; while (parent.length){ if(canScroll||parent.is('.fancybox-skin')||parent.is('.fancybox-wrap')){ break; } canScroll=isScrollable(parent[0]); parent=$(parent).parent(); } if(delta!==0&&!canScroll){ if(F.group.length > 1&&!current.canShrink){ if(deltaY > 0||deltaX > 0){ F.prev(deltaY > 0 ? 'down':'left'); }else if(deltaY < 0||deltaX < 0){ F.next(deltaY < 0 ? 'up':'right'); } e.preventDefault(); }} }); }}, trigger: function (event, o){ var ret, obj=o||F.coming||F.current; if(!obj){ return; } if($.isFunction(obj[event])){ ret=obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); } if(ret===false){ return false; } if(obj.helpers){ $.each(obj.helpers, function (helper, opts){ if(opts&&F.helpers[helper]&&$.isFunction(F.helpers[helper][event])){ F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); }}); } D.trigger(event); }, isImage: function (str){ return isString(str)&&str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); }, isSWF: function (str){ return isString(str)&&str.match(/\.(swf)((\?|#).*)?$/i); }, _start: function (index){ var coming={}, obj, href, type, margin, padding; index=getScalar(index); obj=F.group[ index ]||null; if(!obj){ return false; } coming=$.extend(true, {}, F.opts, obj); margin=coming.margin; padding=coming.padding; if($.type(margin)==='number'){ coming.margin=[margin, margin, margin, margin]; } if($.type(padding)==='number'){ coming.padding=[padding, padding, padding, padding]; } if(coming.modal){ $.extend(true, coming, { closeBtn:false, closeClick:false, nextClick:false, arrows:false, mouseWheel:false, keys:null, helpers: { overlay:{ closeClick:false }} }); } if(coming.autoSize){ coming.autoWidth=coming.autoHeight=true; } if(coming.width==='auto'){ coming.autoWidth=true; } if(coming.height==='auto'){ coming.autoHeight=true; } /* * Add reference to the group, so it`s possible to access from callbacks, example: * afterLoad:function(){ * this.title='Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title:''); * } */ coming.group=F.group; coming.index=index; F.coming=coming; if(false===F.trigger('beforeLoad')){ F.coming=null; return; } type=coming.type; href=coming.href; if(!type){ F.coming=null; if(F.current&&F.router&&F.router!=='jumpto'){ F.current.index=index; return F[ F.router ](F.direction); } return false; } F.isActive=true; if(type==='image'||type==='swf'){ coming.autoHeight=coming.autoWidth=false; coming.scrolling='visible'; } if(type==='image'){ coming.aspectRatio=true; } if(type==='iframe'&&isTouch){ coming.scrolling='scroll'; } coming.wrap=$(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile':'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo(coming.parent||'body'); $.extend(coming, { skin:$('.fancybox-skin', coming.wrap), outer:$('.fancybox-outer', coming.wrap), inner:$('.fancybox-inner', coming.wrap) }); $.each(["Top", "Right", "Bottom", "Left"], function(i, v){ coming.skin.css('padding' + v, getValue(coming.padding[ i ])); }); F.trigger('onReady'); if(type==='inline'||type==='html'){ if(!coming.content||!coming.content.length){ return F._error('content'); }}else if(!href){ return F._error('href'); } if(type==='image'){ F._loadImage(); }else if(type==='ajax'){ F._loadAjax(); }else if(type==='iframe'){ F._loadIframe(); }else{ F._afterLoad(); }}, _error: function(type){ $.extend(F.coming, { type:'html', autoWidth:true, autoHeight:true, minWidth:0, minHeight:0, scrolling:'no', hasError:type, content:F.coming.tpl.error }); F._afterLoad(); }, _loadImage: function (){ var img=F.imgPreload=new Image(); img.onload=function (){ this.onload=this.onerror=null; F.coming.width=this.width / F.opts.pixelRatio; F.coming.height=this.height / F.opts.pixelRatio; F._afterLoad(); }; img.onerror=function (){ this.onload=this.onerror=null; F._error('image'); }; img.src=F.coming.href; if(img.complete!==true){ F.showLoading(); }}, _loadAjax: function (){ var coming=F.coming; F.showLoading(); F.ajaxLoad=$.ajax($.extend({}, coming.ajax, { url: coming.href, error: function (jqXHR, textStatus){ if(F.coming&&textStatus!=='abort'){ F._error('ajax', jqXHR); }else{ F.hideLoading(); }}, success: function (data, textStatus){ if(textStatus==='success'){ coming.content=data; F._afterLoad(); }} })); }, _loadIframe: function(){ var coming=F.coming, iframe=$(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) .attr('scrolling', isTouch ? 'auto':coming.iframe.scrolling) .attr('src', coming.href); $(coming.wrap).bind('onReset', function (){ try { $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); } catch (e){}}); if(coming.iframe.preload){ F.showLoading(); iframe.one('load', function(){ $(this).data('ready', 1); if(!isTouch){ $(this).bind('load.fb', F.update); } $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); F._afterLoad(); }); } coming.content=iframe.appendTo(coming.inner); if(!coming.iframe.preload){ F._afterLoad(); }}, _preloadImages: function(){ var group=F.group, current=F.current, len=group.length, cnt=current.preload ? Math.min(current.preload, len - 1):0, item, i; for (i=1; i <=cnt; i +=1){ item=group[ (current.index + i) % len ]; if(item.type==='image'&&item.href){ new Image().src=item.href; }} }, _afterLoad: function (){ var coming=F.coming, previous=F.current, placeholder='fancybox-placeholder', current, content, type, scrolling, href, embed; F.hideLoading(); if(!coming||F.isActive===false){ return; } if(false===F.trigger('afterLoad', coming, previous)){ coming.wrap.stop(true).trigger('onReset').remove(); F.coming=null; return; } if(previous){ F.trigger('beforeChange', previous); previous.wrap.stop(true).removeClass('fancybox-opened') .find('.fancybox-item, .fancybox-nav') .remove(); } F.unbindEvents(); current=coming; content=coming.content; type=coming.type; scrolling=coming.scrolling; $.extend(F, { wrap:current.wrap, skin:current.skin, outer:current.outer, inner:current.inner, current:current, previous:previous }); href=current.href; switch (type){ case 'inline': case 'ajax': case 'html': if(current.selector){ content=$('
    ').html(content).find(current.selector); }else if(isQuery(content)){ if(!content.data(placeholder)){ content.data(placeholder, $('
    ').insertAfter(content).hide()); } content=content.show().detach(); current.wrap.bind('onReset', function (){ if($(this).find(content).length){ content.hide().replaceAll(content.data(placeholder)).data(placeholder, false); }}); } break; case 'image': content=current.tpl.image.replace('{href}', href); break; case 'swf': content=''; embed=''; $.each(current.swf, function(name, val){ content +=''; embed +=' ' + name + '="' + val + '"'; }); content +=''; break; } if(!(isQuery(content)&&content.parent().is(current.inner))){ current.inner.append(content); } F.trigger('beforeShow'); current.inner.css('overflow', scrolling==='yes' ? 'scroll':(scrolling==='no' ? 'hidden':scrolling)); F._setDimension(); F.reposition(); F.isOpen=false; F.coming=null; F.bindEvents(); if(!F.isOpened){ $('.fancybox-wrap').not(current.wrap).stop(true).trigger('onReset').remove(); }else if(previous.prevMethod){ F.transitions[ previous.prevMethod ](); } F.transitions[ F.isOpened ? current.nextMethod:current.openMethod ](); F._preloadImages(); }, _setDimension: function (){ var viewport=F.getViewport(), steps=0, canShrink=false, canExpand=false, wrap=F.wrap, skin=F.skin, inner=F.inner, current=F.current, width=current.width, height=current.height, minWidth=current.minWidth, minHeight=current.minHeight, maxWidth=current.maxWidth, maxHeight=current.maxHeight, scrolling=current.scrolling, scrollOut=current.scrollOutside ? current.scrollbarWidth:0, margin=current.margin, wMargin=getScalar(margin[1] + margin[3]), hMargin=getScalar(margin[0] + margin[2]), wPadding, hPadding, wSpace, hSpace, origWidth, origHeight, origMaxWidth, origMaxHeight, ratio, width_, height_, maxWidth_, maxHeight_, iframe, body; wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); wPadding=getScalar(skin.outerWidth(true) - skin.width()); hPadding=getScalar(skin.outerHeight(true) - skin.height()); wSpace=wMargin + wPadding; hSpace=hMargin + hPadding; origWidth=isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100:width; origHeight=isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100:height; if(current.type==='iframe'){ iframe=current.content; if(current.autoHeight&&iframe.data('ready')===1){ try { if(iframe[0].contentWindow.document.location){ inner.width(origWidth).height(9999); body=iframe.contents().find('body'); if(scrollOut){ body.css('overflow-x', 'hidden'); } origHeight=body.outerHeight(true); }} catch (e){}} }else if(current.autoWidth||current.autoHeight){ inner.addClass('fancybox-tmp'); if(!current.autoWidth){ inner.width(origWidth); } if(!current.autoHeight){ inner.height(origHeight); } if(current.autoWidth){ origWidth=inner.width(); } if(current.autoHeight){ origHeight=inner.height(); } inner.removeClass('fancybox-tmp'); } width=getScalar(origWidth); height=getScalar(origHeight); ratio=origWidth / origHeight; minWidth=getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace:minWidth); maxWidth=getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace:maxWidth); minHeight=getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace:minHeight); maxHeight=getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace:maxHeight); origMaxWidth=maxWidth; origMaxHeight=maxHeight; if(current.fitToView){ maxWidth=Math.min(viewport.w - wSpace, maxWidth); maxHeight=Math.min(viewport.h - hSpace, maxHeight); } maxWidth_=viewport.w - wMargin; maxHeight_=viewport.h - hMargin; if(current.aspectRatio){ if(width > maxWidth){ width=maxWidth; height=getScalar(width / ratio); } if(height > maxHeight){ height=maxHeight; width=getScalar(height * ratio); } if(width < minWidth){ width=minWidth; height=getScalar(width / ratio); } if(height < minHeight){ height=minHeight; width=getScalar(height * ratio); }}else{ width=Math.max(minWidth, Math.min(width, maxWidth)); if(current.autoHeight&¤t.type!=='iframe'){ inner.width(width); height=inner.height(); } height=Math.max(minHeight, Math.min(height, maxHeight)); } if(current.fitToView){ inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); if(current.aspectRatio){ while ((width_ > maxWidth_||height_ > maxHeight_)&&width > minWidth&&height > minHeight){ if(steps++ > 19){ break; } height=Math.max(minHeight, Math.min(maxHeight, height - 10)); width=getScalar(height * ratio); if(width < minWidth){ width=minWidth; height=getScalar(width / ratio); } if(width > maxWidth){ width=maxWidth; height=getScalar(width / ratio); } inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); }}else{ width=Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); height=Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); }} if(scrollOut&&scrolling==='auto'&&height < origHeight&&(width + wPadding + scrollOut) < maxWidth_){ width +=scrollOut; } inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); canShrink=(width_ > maxWidth_||height_ > maxHeight_)&&width > minWidth&&height > minHeight; canExpand=current.aspectRatio ? (width < origMaxWidth&&height < origMaxHeight&&width < origWidth&&height < origHeight):((width < origMaxWidth||height < origMaxHeight)&&(width < origWidth||height < origHeight)); $.extend(current, { dim:{ width:getValue(width_), height:getValue(height_) }, origWidth:origWidth, origHeight:origHeight, canShrink:canShrink, canExpand:canExpand, wPadding:wPadding, hPadding:hPadding, wrapSpace:height_ - skin.outerHeight(true), skinSpace:skin.height() - height }); if(!iframe&¤t.autoHeight&&height > minHeight&&height < maxHeight&&!canExpand){ inner.height('auto'); }}, _getPosition: function (onlyAbsolute){ var current=F.current, viewport=F.getViewport(), margin=current.margin, width=F.wrap.width() + margin[1] + margin[3], height=F.wrap.height() + margin[0] + margin[2], rez={ position: 'absolute', top:margin[0], left:margin[3] }; if(current.autoCenter&¤t.fixed&&!onlyAbsolute&&height <=viewport.h&&width <=viewport.w){ rez.position='fixed'; }else if(!current.locked){ rez.top +=viewport.y; rez.left +=viewport.x; } rez.top=getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); rez.left=getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); return rez; }, _afterZoomIn: function (){ var current=F.current; if(!current){ return; } F.isOpen=F.isOpened=true; F.wrap.css('overflow', 'visible').addClass('fancybox-opened'); F.update(); if(current.closeClick||(current.nextClick&&F.group.length > 1)){ F.inner.css('cursor', 'pointer').bind('click.fb', function(e){ if(!$(e.target).is('a')&&!$(e.target).parent().is('a')){ e.preventDefault(); F[ current.closeClick ? 'close':'next' ](); }}); } if(current.closeBtn){ $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e){ e.preventDefault(); F.close(); }); } if(current.arrows&&F.group.length > 1){ if(current.loop||current.index > 0){ $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); } if(current.loop||current.index < F.group.length - 1){ $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); }} F.trigger('afterShow'); if(!current.loop&¤t.index===current.group.length - 1){ F.play(false); }else if(F.opts.autoPlay&&!F.player.isActive){ F.opts.autoPlay=false; F.play(); }}, _afterZoomOut: function(obj){ obj=obj||F.current; $('.fancybox-wrap').trigger('onReset').remove(); $.extend(F, { group:{}, opts:{}, router:false, current:null, isActive:false, isOpened:false, isOpen:false, isClosing:false, wrap:null, skin:null, outer:null, inner:null }); F.trigger('afterClose', obj); }}); F.transitions={ getOrigPosition: function (){ var current=F.current, element=current.element, orig=current.orig, pos={}, width=50, height=50, hPadding=current.hPadding, wPadding=current.wPadding, viewport=F.getViewport(); if(!orig&¤t.isDom&&element.is(':visible')){ orig=element.find('img:first'); if(!orig.length){ orig=element; }} if(isQuery(orig)){ pos=orig.offset(); if(orig.is('img')){ width=orig.outerWidth(); height=orig.outerHeight(); }}else{ pos.top=viewport.y + (viewport.h - height) * current.topRatio; pos.left=viewport.x + (viewport.w - width) * current.leftRatio; } if(F.wrap.css('position')==='fixed'||current.locked){ pos.top -=viewport.y; pos.left -=viewport.x; } pos={ top:getValue(pos.top - hPadding * current.topRatio), left:getValue(pos.left - wPadding * current.leftRatio), width:getValue(width + wPadding), height:getValue(height + hPadding) }; return pos; }, step: function (now, fx){ var ratio, padding, value, prop=fx.prop, current=F.current, wrapSpace=current.wrapSpace, skinSpace=current.skinSpace; if(prop==='width'||prop==='height'){ ratio=fx.end===fx.start ? 1:(now - fx.start) / (fx.end - fx.start); if(F.isClosing){ ratio=1 - ratio; } padding=prop==='width' ? current.wPadding:current.hPadding; value=now - padding; F.skin[ prop ](getScalar(prop==='width' ? value:value - (wrapSpace * ratio))); F.inner[ prop ](getScalar(prop==='width' ? value:value - (wrapSpace * ratio) - (skinSpace * ratio))); }}, zoomIn: function (){ var current=F.current, startPos=current.pos, effect=current.openEffect, elastic=effect==='elastic', endPos=$.extend({opacity:1}, startPos); delete endPos.position; if(elastic){ startPos=this.getOrigPosition(); if(current.openOpacity){ startPos.opacity=0.1; }}else if(effect==='fade'){ startPos.opacity=0.1; } F.wrap.css(startPos).animate(endPos, { duration:effect==='none' ? 0:current.openSpeed, easing:current.openEasing, step:elastic ? this.step:null, complete:F._afterZoomIn }); }, zoomOut: function (){ var current=F.current, effect=current.closeEffect, elastic=effect==='elastic', endPos={opacity:0.1}; if(elastic){ endPos=this.getOrigPosition(); if(current.closeOpacity){ endPos.opacity=0.1; }} F.wrap.animate(endPos, { duration:effect==='none' ? 0:current.closeSpeed, easing:current.closeEasing, step:elastic ? this.step:null, complete:F._afterZoomOut }); }, changeIn: function (){ var current=F.current, effect=current.nextEffect, startPos=current.pos, endPos={ opacity:1 }, direction=F.direction, distance=200, field; startPos.opacity=0.1; if(effect==='elastic'){ field=direction==='down'||direction==='up' ? 'top':'left'; if(direction==='down'||direction==='right'){ startPos[ field ]=getValue(getScalar(startPos[ field ]) - distance); endPos[ field ]='+=' + distance + 'px'; }else{ startPos[ field ]=getValue(getScalar(startPos[ field ]) + distance); endPos[ field ]='-=' + distance + 'px'; }} if(effect==='none'){ F._afterZoomIn(); }else{ F.wrap.css(startPos).animate(endPos, { duration:current.nextSpeed, easing:current.nextEasing, complete:F._afterZoomIn }); }}, changeOut: function (){ var previous=F.previous, effect=previous.prevEffect, endPos={ opacity:0.1 }, direction=F.direction, distance=200; if(effect==='elastic'){ endPos[ direction==='down'||direction==='up' ? 'top':'left' ]=(direction==='up'||direction==='left' ? '-':'+') + '=' + distance + 'px'; } previous.wrap.animate(endPos, { duration:effect==='none' ? 0:previous.prevSpeed, easing:previous.prevEasing, complete:function (){ $(this).trigger('onReset').remove(); }}); }}; F.helpers.overlay={ defaults:{ closeClick:true, speedOut:200, showEarly:true, css:{}, locked:!isTouch, fixed:true }, overlay:null, fixed:false, el:$('html'), create:function(opts){ opts=$.extend({}, this.defaults, opts); if(this.overlay){ this.close(); } this.overlay=$('
    ').appendTo(F.coming ? F.coming.parent:opts.parent); this.fixed=false; if(opts.fixed&&F.defaults.fixed){ this.overlay.addClass('fancybox-overlay-fixed'); this.fixed=true; }}, open:function(opts){ var that=this; opts=$.extend({}, this.defaults, opts); if(this.overlay){ this.overlay.unbind('.overlay').width('auto').height('auto'); }else{ this.create(opts); } if(!this.fixed){ W.bind('resize.overlay', $.proxy(this.update, this)); this.update(); } if(opts.closeClick){ this.overlay.bind('click.overlay', function(e){ if($(e.target).hasClass('fancybox-overlay')){ if(F.isActive){ F.close(); }else{ that.close(); } return false; }}); } this.overlay.css(opts.css).show(); }, close:function(){ var scrollV, scrollH; W.unbind('resize.overlay'); if(this.el.hasClass('fancybox-lock')){ $('.fancybox-margin').removeClass('fancybox-margin'); scrollV=W.scrollTop(); scrollH=W.scrollLeft(); this.el.removeClass('fancybox-lock'); W.scrollTop(scrollV).scrollLeft(scrollH); } $('.fancybox-overlay').remove().hide(); $.extend(this, { overlay:null, fixed:false }); }, update:function (){ var width='100%', offsetWidth; this.overlay.width(width).height('100%'); if(IE){ offsetWidth=Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if(D.width() > offsetWidth){ width=D.width(); }}else if(D.width() > W.width()){ width=D.width(); } this.overlay.width(width).height(D.height()); }, onReady:function (opts, obj){ var overlay=this.overlay; $('.fancybox-overlay').stop(true, true); if(!overlay){ this.create(opts); } if(opts.locked&&this.fixed&&obj.fixed){ if(!overlay){ this.margin=D.height() > W.height() ? $('html').css('margin-right').replace("px", ""):false; } obj.locked=this.overlay.append(obj.wrap); obj.fixed=false; } if(opts.showEarly===true){ this.beforeShow.apply(this, arguments); }}, beforeShow:function(opts, obj){ var scrollV, scrollH; if(obj.locked){ if(this.margin!==false){ $('*').filter(function(){ return ($(this).css('position')==='fixed'&&!$(this).hasClass("fancybox-overlay")&&!$(this).hasClass("fancybox-wrap")); }).addClass('fancybox-margin'); this.el.addClass('fancybox-margin'); } scrollV=W.scrollTop(); scrollH=W.scrollLeft(); this.el.addClass('fancybox-lock'); W.scrollTop(scrollV).scrollLeft(scrollH); } this.open(opts); }, onUpdate:function(){ if(!this.fixed){ this.update(); }}, afterClose: function (opts){ if(this.overlay&&!F.coming){ this.overlay.fadeOut(opts.speedOut, $.proxy(this.close, this)); }} }; F.helpers.title={ defaults:{ type:'float', // 'float', 'inside', 'outside' or 'over', position:'bottom' // 'top' or 'bottom' }, beforeShow: function (opts){ var current=F.current, text=current.title, type=opts.type, title, target; if($.isFunction(text)){ text=text.call(current.element, current); } if(!isString(text)||$.trim(text)===''){ return; } title=$('
    ' + text + '
    '); switch (type){ case 'inside': target=F.skin; break; case 'outside': target=F.wrap; break; case 'over': target=F.inner; break; default: // 'float' target=F.skin; title.appendTo('body'); if(IE){ title.width(title.width()); } title.wrapInner(''); F.current.margin[2] +=Math.abs(getScalar(title.css('margin-bottom'))); break; } title[ (opts.position==='top' ? 'prependTo':'appendTo') ](target); }}; $.fn.fancybox=function (options){ var index, that=$(this), selector=this.selector||'', run=function(e){ var what=$(this).blur(), idx=index, relType, relVal; if(!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&!what.is('.fancybox-wrap')){ relType=options.groupAttr||'data-fancybox-group'; relVal=what.attr(relType); if(!relVal){ relType='rel'; relVal=what.get(0)[ relType ]; } if(relVal&&relVal!==''&&relVal!=='nofollow'){ what=selector.length ? $(selector):that; what=what.filter('[' + relType + '="' + relVal + '"]'); idx=what.index(this); } options.index=idx; if(F.open(what, options)!==false){ e.preventDefault(); }} }; options=options||{}; index=options.index||0; if(!selector||options.live===false){ that.unbind('click.fb-start').bind('click.fb-start', run); }else{ D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); } this.filter('[data-fancybox-start=1]').trigger('click'); return this; }; D.ready(function(){ var w1, w2; if($.scrollbarWidth===undefined){ $.scrollbarWidth=function(){ var parent=$('
    ').appendTo('body'), child=parent.children(), width=child.innerWidth() - child.height(99).innerWidth(); parent.remove(); return width; };} if($.support.fixedPosition===undefined){ $.support.fixedPosition=(function(){ var elem=$('
    ').appendTo('body'), fixed=(elem[0].offsetTop===20||elem[0].offsetTop===15); elem.remove(); return fixed; }()); } $.extend(F.defaults, { scrollbarWidth:$.scrollbarWidth(), fixed:$.support.fixedPosition, parent:$('body') }); w1=$(window).width(); H.addClass('fancybox-lock-test'); w2=$(window).width(); H.removeClass('fancybox-lock-test'); $("").appendTo("head"); }); }(window, document, jQuery)); (function (factory){ "use strict"; if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else{ if(typeof module==='object'&&module.exports){ module.exports=factory(require('jquery')); }else{ factory(window.jQuery); }} }(function ($){ "use strict"; $.fn.ratingLocales={}; $.fn.ratingThemes={}; var $h, Rating; $h={ NAMESPACE: '.rating', DEFAULT_MIN: 0, DEFAULT_MAX: 5, DEFAULT_STEP: 0.5, isEmpty: function (value, trim){ return value===null||value===undefined||value.length===0||(trim&&$.trim(value)===''); }, getCss: function (condition, css){ return condition ? ' ' + css:''; }, addCss: function ($el, css){ $el.removeClass(css).addClass(css); }, getDecimalPlaces: function (num){ var m=('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); return !m ? 0:Math.max(0, (m[1] ? m[1].length:0) - (m[2] ? +m[2]:0)); }, applyPrecision: function (val, precision){ return parseFloat(val.toFixed(precision)); }, handler: function ($el, event, callback, skipOff, skipNS){ var ev=skipNS ? event:event.split(' ').join($h.NAMESPACE + ' ') + $h.NAMESPACE; if(!skipOff){ $el.off(ev); } $el.on(ev, callback); }}; Rating=function (element, options){ var self=this; self.$element=$(element); self._init(options); }; Rating.prototype={ constructor: Rating, _parseAttr: function (vattr, options){ var self=this, $el=self.$element, elType=$el.attr('type'), finalVal, val, chk, out; if(elType==='range'||elType==='number'){ val=options[vattr]||$el.data(vattr)||$el.attr(vattr); switch (vattr){ case 'min': chk=$h.DEFAULT_MIN; break; case 'max': chk=$h.DEFAULT_MAX; break; default: chk=$h.DEFAULT_STEP; } finalVal=$h.isEmpty(val) ? chk:val; out=parseFloat(finalVal); }else{ out=parseFloat(options[vattr]); } return isNaN(out) ? chk:out; }, _parseValue: function (val){ var self=this, v=parseFloat(val); if(isNaN(v)){ v=self.clearValue; } return (self.zeroAsNull&&(v===0||v==='0') ? null:v); }, _setDefault: function (key, val){ var self=this; if($h.isEmpty(self[key])){ self[key]=val; }}, _initSlider: function (options){ var self=this, v=self.$element.val(); self.initialValue=$h.isEmpty(v) ? 0:v; self._setDefault('min', self._parseAttr('min', options)); self._setDefault('max', self._parseAttr('max', options)); self._setDefault('step', self._parseAttr('step', options)); if(isNaN(self.min)||$h.isEmpty(self.min)){ self.min=$h.DEFAULT_MIN; } if(isNaN(self.max)||$h.isEmpty(self.max)){ self.max=$h.DEFAULT_MAX; } if(isNaN(self.step)||$h.isEmpty(self.step)||self.step===0){ self.step=$h.DEFAULT_STEP; } self.diff=self.max - self.min; }, _initHighlight: function (v){ var self=this, w, cap=self._getCaption(); if(!v){ v=self.$element.val(); } w=self.getWidthFromValue(v) + '%'; self.$filledStars.width(w); self.cache={caption: cap, width: w, val: v};}, _getContainerCss: function (){ var self=this; return 'rating-container' + $h.getCss(self.theme, 'theme-' + self.theme) + $h.getCss(self.rtl, 'rating-rtl') + $h.getCss(self.size, 'rating-' + self.size) + $h.getCss(self.animate, 'rating-animate') + $h.getCss(self.disabled||self.readonly, 'rating-disabled') + $h.getCss(self.containerClass, self.containerClass); }, _checkDisabled: function (){ var self=this, $el=self.$element, opts=self.options; self.disabled=opts.disabled===undefined ? $el.attr('disabled')||false:opts.disabled; self.readonly=opts.readonly===undefined ? $el.attr('readonly')||false:opts.readonly; self.inactive=(self.disabled||self.readonly); $el.attr({disabled: self.disabled, readonly: self.readonly}); }, _addContent: function (type, content){ var self=this, $container=self.$container, isClear=type==='clear'; if(self.rtl){ return isClear ? $container.append(content):$container.prepend(content); }else{ return isClear ? $container.prepend(content):$container.append(content); }}, _generateRating: function (){ var self=this, $el=self.$element, $rating, $container, w; $container=self.$container=$(document.createElement("div")).insertBefore($el); $h.addCss($container, self._getContainerCss()); self.$rating=$rating=$(document.createElement("div")).attr('class', 'rating-stars').appendTo($container) .append(self._getStars('empty')).append(self._getStars('filled')); self.$emptyStars=$rating.find('.empty-stars'); self.$filledStars=$rating.find('.filled-stars'); self._renderCaption(); self._renderClear(); self._initHighlight(); $container.append($el); if(self.rtl){ w=Math.max(self.$emptyStars.outerWidth(), self.$filledStars.outerWidth()); self.$emptyStars.width(w); } $el.appendTo($rating); }, _getCaption: function (){ var self=this; return self.$caption&&self.$caption.length ? self.$caption.html():self.defaultCaption; }, _setCaption: function (content){ var self=this; if(self.$caption&&self.$caption.length){ self.$caption.html(content); }}, _renderCaption: function (){ var self=this, val=self.$element.val(), html, $cap=self.captionElement ? $(self.captionElement):''; if(!self.showCaption){ return; } html=self.fetchCaption(val); if($cap&&$cap.length){ $h.addCss($cap, 'caption'); $cap.html(html); self.$caption=$cap; return; } self._addContent('caption', '
    ' + html + '
    '); self.$caption=self.$container.find(".caption"); }, _renderClear: function (){ var self=this, css, $clr=self.clearElement ? $(self.clearElement):''; if(!self.showClear){ return; } css=self._getClearClass(); if($clr.length){ $h.addCss($clr, css); $clr.attr({"title": self.clearButtonTitle}).html(self.clearButton); self.$clear=$clr; return; } self._addContent('clear', '
    ' + self.clearButton + '
    '); self.$clear=self.$container.find('.' + self.clearButtonBaseClass); }, _getClearClass: function (){ var self=this; return self.clearButtonBaseClass + ' ' + (self.inactive ? '':self.clearButtonActiveClass); }, _toggleHover: function (out){ var self=this, w, width, caption; if(!out){ return; } if(self.hoverChangeStars){ w=self.getWidthFromValue(self.clearValue); width=out.val <=self.clearValue ? w + '%':out.width; self.$filledStars.css('width', width); } if(self.hoverChangeCaption){ caption=out.val <=self.clearValue ? self.fetchCaption(self.clearValue):out.caption; if(caption){ self._setCaption(caption + ''); }} }, _init: function (options){ var self=this, $el=self.$element.addClass('rating-input'), v; self.options=options; $.each(options, function (key, value){ self[key]=value; }); if(self.rtl||$el.attr('dir')==='rtl'){ self.rtl=true; $el.attr('dir', 'rtl'); } self.starClicked=false; self.clearClicked=false; self._initSlider(options); self._checkDisabled(); if(self.displayOnly){ self.inactive=true; self.showClear=false; self.showCaption=false; } self._generateRating(); self._initEvents(); self._listen(); v=self._parseValue($el.val()); $el.val(v); return $el.removeClass('rating-loading'); }, _initEvents: function (){ var self=this; self.events={ _getTouchPosition: function (e){ var pageX=$h.isEmpty(e.pageX) ? e.originalEvent.touches[0].pageX:e.pageX; return pageX - self.$rating.offset().left; }, _listenClick: function (e, callback){ e.stopPropagation(); e.preventDefault(); if(e.handled!==true){ callback(e); e.handled=true; }else{ return false; }}, _noMouseAction: function (e){ return !self.hoverEnabled||self.inactive||(e&&e.isDefaultPrevented()); }, initTouch: function (e){ var ev, touches, pos, out, caption, w, width, params, clrVal=self.clearValue||0, isTouchCapable='ontouchstart' in window || (window.DocumentTouch&&document instanceof window.DocumentTouch); if(!isTouchCapable||self.inactive){ return; } ev=e.originalEvent; touches = !$h.isEmpty(ev.touches) ? ev.touches:ev.changedTouches; pos=self.events._getTouchPosition(touches[0]); if(e.type==="touchend"){ self._setStars(pos); params=[self.$element.val(), self._getCaption()]; self.$element.trigger('change').trigger('rating:change', params); self.starClicked=true; }else{ out=self.calculate(pos); caption=out.val <=clrVal ? self.fetchCaption(clrVal):out.caption; w=self.getWidthFromValue(clrVal); width=out.val <=clrVal ? w + '%':out.width; self._setCaption(caption); self.$filledStars.css('width', width); }}, starClick: function (e){ var pos, params; self.events._listenClick(e, function (ev){ if(self.inactive){ return false; } pos=self.events._getTouchPosition(ev); self._setStars(pos); params=[self.$element.val(), self._getCaption()]; self.$element.trigger('change').trigger('rating.change', params); self.starClicked=true; }); }, clearClick: function (e){ self.events._listenClick(e, function (){ if(!self.inactive){ self.clear(); self.clearClicked=true; }}); }, starMouseMove: function (e){ var pos, out; if(self.events._noMouseAction(e)){ return; } self.starClicked=false; pos=self.events._getTouchPosition(e); out=self.calculate(pos); self._toggleHover(out); self.$element.trigger('rating:hover', [out.val, out.caption, 'stars']); }, starMouseLeave: function (e){ var out; if(self.events._noMouseAction(e)||self.starClicked){ return; } out=self.cache; self._toggleHover(out); self.$element.trigger('rating:hoverleave', ['stars']); }, clearMouseMove: function (e){ var caption, val, width, out; if(self.events._noMouseAction(e)||!self.hoverOnClear){ return; } self.clearClicked=false; caption='' + self.clearCaption + ''; val=self.clearValue; width=self.getWidthFromValue(val)||0; out={caption: caption, width: width, val: val}; self._toggleHover(out); self.$element.trigger('rating:hover', [val, caption, 'clear']); }, clearMouseLeave: function (e){ var out; if(self.events._noMouseAction(e)||self.clearClicked||!self.hoverOnClear){ return; } out=self.cache; self._toggleHover(out); self.$element.trigger('rating:hoverleave', ['clear']); }, resetForm: function (e){ if(e&&e.isDefaultPrevented()){ return; } if(!self.inactive){ self.reset(); }} };}, _listen: function (){ var self=this, $el=self.$element, $form=$el.closest('form'), $rating=self.$rating, $clear=self.$clear, events=self.events; $h.handler($rating, 'touchstart touchmove touchend', $.proxy(events.initTouch, self)); $h.handler($rating, 'click touchstart', $.proxy(events.starClick, self)); $h.handler($rating, 'mousemove', $.proxy(events.starMouseMove, self)); $h.handler($rating, 'mouseleave', $.proxy(events.starMouseLeave, self)); if(self.showClear&&$clear.length){ $h.handler($clear, 'click touchstart', $.proxy(events.clearClick, self)); $h.handler($clear, 'mousemove', $.proxy(events.clearMouseMove, self)); $h.handler($clear, 'mouseleave', $.proxy(events.clearMouseLeave, self)); } if($form.length){ $h.handler($form, 'reset', $.proxy(events.resetForm, self), true); } return $el; }, _getStars: function (type){ var self=this, stars='', i; for (i=1; i <=self.stars; i++){ stars +='' + self[type + 'Star'] + ''; } return stars + ''; }, _setStars: function (pos){ var self=this, out=arguments.length ? self.calculate(pos):self.calculate(), $el=self.$element, v=self._parseValue(out.val); $el.val(v); self.$filledStars.css('width', out.width); self._setCaption(out.caption); self.cache=out; return $el; }, showStars: function (val){ var self=this, v=self._parseValue(val); self.$element.val(v); return self._setStars(); }, calculate: function (pos){ var self=this, defaultVal=$h.isEmpty(self.$element.val()) ? 0:self.$element.val(), val=arguments.length ? self.getValueFromPosition(pos):defaultVal, caption=self.fetchCaption(val), width=self.getWidthFromValue(val); width +='%'; return {caption: caption, width: width, val: val};}, getValueFromPosition: function (pos){ var self=this, precision=$h.getDecimalPlaces(self.step), val, factor, maxWidth=self.$rating.width(); factor=(self.diff * pos) / (maxWidth * self.step); factor=self.rtl ? Math.floor(factor):Math.ceil(factor); val=$h.applyPrecision(parseFloat(self.min + factor * self.step), precision); val=Math.max(Math.min(val, self.max), self.min); return self.rtl ? (self.max - val):val; }, getWidthFromValue: function (val){ var self=this, min=self.min, max=self.max, factor, $r=self.$emptyStars, w; if(!val||val <=min||min===max){ return 0; } w=$r.outerWidth(); factor=w ? $r.width() / w:1; if(val >=max){ return 100; } return (val - min) * factor * 100 / (max - min); }, fetchCaption: function (rating){ var self=this, val=parseFloat(rating)||self.clearValue, css, cap, capVal, cssVal, caption, vCap=self.starCaptions, vCss=self.starCaptionClasses; if(val&&val!==self.clearValue){ val=$h.applyPrecision(val, $h.getDecimalPlaces(self.step)); } cssVal=typeof vCss==="function" ? vCss(val):vCss[val]; capVal=typeof vCap==="function" ? vCap(val):vCap[val]; cap=$h.isEmpty(capVal) ? self.defaultCaption.replace(/\{rating}/g, val):capVal; css=$h.isEmpty(cssVal) ? self.clearCaptionClass:cssVal; caption=(val===self.clearValue) ? self.clearCaption:cap; return '' + caption + ''; }, destroy: function (){ var self=this, $el=self.$element; if(!$h.isEmpty(self.$container)){ self.$container.before($el).remove(); } $.removeData($el.get(0)); return $el.off('rating').removeClass('rating rating-input'); }, create: function (options){ var self=this, opts=options||self.options||{}; return self.destroy().rating(opts); }, clear: function (){ var self=this, title='' + self.clearCaption + ''; if(!self.inactive){ self._setCaption(title); } return self.showStars(self.clearValue).trigger('change').trigger('rating:clear'); }, reset: function (){ var self=this; return self.showStars(self.initialValue).trigger('rating:reset'); }, update: function (val){ var self=this; return arguments.length ? self.showStars(val):self.$element; }, refresh: function (options){ var self=this, $el=self.$element; if(!options){ return $el; } return self.destroy().rating($.extend(true, self.options, options)).trigger('rating:refresh'); }}; $.fn.rating=function (option){ var args=Array.apply(null, arguments), retvals=[]; args.shift(); this.each(function (){ var self=$(this), data=self.data('rating'), options=typeof option==='object'&&option, theme=options.theme||self.data('theme'), lang=options.language||self.data('language')||'en', thm={}, loc={}, opts; if(!data){ if(theme){ thm=$.fn.ratingThemes[theme]||{};} if(lang!=='en'&&!$h.isEmpty($.fn.ratingLocales[lang])){ loc=$.fn.ratingLocales[lang]; } opts=$.extend(true, {}, $.fn.rating.defaults, thm, $.fn.ratingLocales.en, loc, options, self.data()); data=new Rating(this, opts); self.data('rating', data); } if(typeof option==='string'){ retvals.push(data[option].apply(data, args)); }}); switch (retvals.length){ case 0: return this; case 1: return retvals[0]===undefined ? this:retvals[0]; default: return retvals; }}; $.fn.rating.defaults={ theme: '', language: 'en', stars: 5, filledStar: '', emptyStar: '', containerClass: '', size: 'md', animate: true, displayOnly: false, rtl: false, showClear: true, showCaption: true, starCaptionClasses: { 0.5: 'label label-danger badge-danger', 1: 'label label-danger badge-danger', 1.5: 'label label-warning badge-warning', 2: 'label label-warning badge-warning', 2.5: 'label label-info badge-info', 3: 'label label-info badge-info', 3.5: 'label label-primary badge-primary', 4: 'label label-primary badge-primary', 4.5: 'label label-success badge-success', 5: 'label label-success badge-success' }, clearButton: '', clearButtonBaseClass: 'clear-rating', clearButtonActiveClass: 'clear-rating-active', clearCaptionClass: 'label label-default', clearValue: null, captionElement: null, clearElement: null, hoverEnabled: true, hoverChangeCaption: true, hoverChangeStars: true, hoverOnClear: true, zeroAsNull: true }; $.fn.ratingLocales.en={ defaultCaption: '{rating} Stars', starCaptions: { 0.5: 'Half Star', 1: 'One Star', 1.5: 'One & Half Star', 2: 'Two Stars', 2.5: 'Two & Half Stars', 3: 'Three Stars', 3.5: 'Three & Half Stars', 4: 'Four Stars', 4.5: 'Four & Half Stars', 5: 'Five Stars' }, clearButtonTitle: 'Clear', clearCaption: 'Not Rated' }; $.fn.rating.Constructor=Rating; $(document).ready(function (){ var $input=$('input.rating'); if($input.length){ $input.removeClass('rating-loading').addClass('rating-loading').rating(); }}); })); !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,checkVisibility:!0,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",slideTransition:"",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g>0;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i,g-=1;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("
    ",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.isVisible()&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&bi-g-f&&b",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){(a=this.normalize(a))!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>d););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2==0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.isVisible()&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){(a=this.normalize(a,!0))!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),!1!==this.settings.responsive&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$stage.remove(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a":return d?ac;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));f++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src")||f.attr("data-srcset");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(c){this._core=c,this._previousHeight=null,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"===a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='
    ',d=k.lazyLoad?a("
    ",{class:"owl-video-tn "+j,srcType:c}):a("
    ",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("
    ",{class:"owl-video-wrapper",style:g})),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),c=a(''),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('
    ').insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1, animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._call=null,this._time=0,this._timeout=0,this._paused=!0,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._paused&&(this._time=0)},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('
    '+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"
    ")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:['',''],navSpeed:!1,navElement:'button type="button" role="presentation"',navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("
    ").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a('
    ');var n=e.find(".dddwrapper"),d=e.find(".dddwrapper-layer");e.find(".dddwrapper-layertobggroup").appendTo(n),"carousel"==i[t].sliderType&&(a.ddd_shadow&&n.addClass("dddwrappershadow"),tpGS.gsap.set(n,{borderRadius:i[t].carousel.border_radius})),tpGS.gsap.set(e,{overflow:"visible",transformStyle:"preserve-3d",perspective:1600}),tpGS.gsap.set(n,{force3D:"auto",transformOrigin:"50% 50%",transformStyle:"preserve-3d",transformPerspective:1600}),tpGS.gsap.set(d,{force3D:"auto",transformOrigin:"50% 50%",zIndex:5,transformStyle:"flat",transformPerspective:1600}),tpGS.gsap.set(i[t].canvas,{transformStyle:"preserve-3d",transformPerspective:1600})};function a(t,a,o,r){e(o).find(".rs-pxl-"+t).each(function(){var e=this.className.indexOf("rs-pxmask")>=0,o=e?i.closestNode(this,"RS-PX-MASK"):i.closestClass(this,"rs-parallax-wrap");o&&(e&&!window.isSafari11&&(tpGS.gsap.set(o,{z:1}),tpGS.gsap.set(i.closestNode(o,"RS-BG-ELEM"),{z:1})),o.dataset.parallaxlevel=a.levels[t-1],o.classList.add("tp-parallax-container"),r[this.id]={tpw:o,depth:a.levels[t-1],offsv:0,offsh:0})})}window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.parallax={loaded:!0,version:"6.5.20"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(jQuery),function(e){"use strict";window._R_is_Editor?RVS._R=void 0===RVS._R?{}:RVS._R:window._R_is_Editor=!1;jQuery.fn.revolution=jQuery.fn.revolution||{};var i=_R_is_Editor?RVS._R:jQuery.fn.revolution;_R_is_Editor&&(RVS._R.isNumeric=RVS.F.isNumeric),jQuery.extend(!0,i,{getSlideAnimationObj:function(e,t,a){var o,r={};for(var s in void 0===t.anim&&null==t.in&&(t.in="o:0"),t)if(t.hasOwnProperty(s)&&void 0!==t[s]){var n=t[s].split(";");for(var d in n)n.hasOwnProperty(d)&&void 0!==(o=n[d].split(":"))[0]&&void 0!==o[1]&&(r[s]=void 0===r[s]?{}:r[s],r[s][o[0]]="d3"===s&&"c"===o[0]?o[1]:o[1].split(",")[0])}return r.in=void 0===r.in?{}:r.in,r.anim=void 0===r.anim?{e:"basic"}:r.anim,_R_is_Editor||void 0===r.in||void 0===r.in.prst||i.loadSlideAnimLibrary(e,{key:a,prst:r.in.prst}),i[e].sbgs[a].slideanimationRebuild=!1,r},loadSlideAnimLibrary:function(e,t){void 0===i.SLTR&&!0!==i.SLTR_loading?(i.SLTR_loading=!0,jQuery.ajax({type:"post",url:i[e].ajaxUrl,dataType:"json",data:{action:"revslider_ajax_call_front",client_action:"get_transitions"},success:function(a,o,r){1==a.success&&(i.SLTR=a.transitions,void 0!==t&&i.setRandomDefaults(e,t.key,t.prst))},error:function(e){console.log("Transition Table can not be loaded"),console.log(e)}})):void 0!==t&&void 0!==i.SLTR&&i.setRandomDefaults(e,t.key,t.prst)},convertSlideAnimVals:function(e){return{anim:{eng:e.eng,ms:parseInt(e.speed,0),o:e.o,e:e.e,f:e.f,p:e.p,d:parseInt(e.d,0),adpr:e.adpr},d3:{f:e.d3.f,d:e.d3.d,z:e.d3.z,t:e.d3.t,c:e.d3.c,e:e.d3.e,fdi:e.d3.fdi,fdo:e.d3.fdo,fz:e.d3.fz,su:e.d3.su,smi:e.d3.smi,sma:e.d3.sma,sc:e.d3.sc,sl:e.d3.sl},in:{eng:e.in.eng,o:_R_is_Editor&&void 0!==e.preset&&0===e.preset.indexOf("rnd")?0:i.valBeau(e.in.o),x:i.valBeau(e.in.x),y:i.valBeau(e.in.y),r:i.valBeau(e.in.r),sx:i.valBeau(e.in.sx),sy:i.valBeau(e.in.sy),m:e.in.m,e:e.in.e,row:e.in.row,col:e.in.col,mo:"false"!==e.in.mou&&!1!==e.in.mou?i.valBeau(e.in.mo):0,moo:"false"!==e.in.mou&&!1!==e.in.mou?i.valBeau(e.in.moo):"none",mou:e.in.mou},out:void 0===e.out.a||"true"==e.out.a||!0===e.out.a?void 0:{a:d(e.out.a),o:i.valBeau(e.out.o),x:i.valBeau(e.out.x),y:i.valBeau(e.out.y),r:i.valBeau(e.out.r),sx:i.valBeau(e.out.sx),sy:i.valBeau(e.out.sy),m:e.out.m,e:e.out.e,row:i.valBeau(e.out.row),col:i.valBeau(e.out.col)},filter:{u:e.filter.u,e:e.filter.e,b:e.filter.b,g:e.filter.g,h:e.filter.h,s:e.filter.s,c:e.filter.c,i:e.filter.i},addOns:e.addOns}},setRandomDefaults:function(e,t,a){i[e].sbgs[t].random=i.getAnimObjectByKey(a,i.SLTR)},getSlideAnim_AddonDefaults:function(){var e={};for(var t in i.enabledSlideAnimAddons)e=jQuery.extend(!0,e,i[i.enabledSlideAnimAddons[t]].defaults());return e},getSlideAnim_EmptyObject:function(){return{speed:1e3,o:"inout",e:"basic",f:"start",p:"none",d:15,eng:"animateCore",adpr:!1,d3:{f:"none",d:"horizontal",z:300,t:0,c:"#ccc",e:"power2.inOut",fdi:1.5,fdo:2,fz:0,su:!1,smi:0,sma:.5,sc:"#000",sl:1},filter:{u:!1,e:"default",b:0,g:0,h:100,s:0,c:100,i:0},in:{o:1,x:0,y:0,r:0,sx:1,sy:1,m:!1,e:"power2.inOut",row:1,col:1,mo:80,mou:!1},out:{a:"true",o:1,x:0,y:0,r:0,sx:1,sy:1,m:!1,e:"power2.inOut",row:1,col:1},addOns:i.getSlideAnim_AddonDefaults()}},getAnimObjectByKey:function(e,t){if(i.getAnimObjectCacheKey===e)return i.getAnimObjectCache;var a;for(var o in i.getAnimObjectCacheKey=e,t)if(t.hasOwnProperty(o)&&void 0===a)for(var r in t[o])if(t[o].hasOwnProperty(r)&&void 0===a)if(e===r&&0===e.indexOf("rnd"))(a=t[o][r]).main=o,a.group=r;else for(var s in t[o][r])t[o][r].hasOwnProperty(s)&&void 0===a&&s===e&&((a=t[o][r][s]).main=o,a.group=r);return i.getAnimObjectCache=jQuery.extend(!0,{},a),a},getRandomSlideTrans:function(e,t,a){if(void 0!==i.randomSlideAnimCache&&void 0!==i.randomSlideAnimCache[e]&&void 0!==i.randomSlideAnimCache[e][t])return i.randomSlideAnimCache[e][t][Math.floor(Math.random()*i.randomSlideAnimCache[e][t].length)];for(var o in i.randomSlideAnimCache=void 0===i.randomSlideAnimCache?{}:i.randomSlideAnimCache,i.randomSlideAnimCache[e]=void 0===i.randomSlideAnimCache[e]?{}:i.randomSlideAnimCache[e],i.randomSlideAnimCache[e][t]=void 0===i.randomSlideAnimCache[e][t]?[]:i.randomSlideAnimCache[e][t],a)if(a.hasOwnProperty(o)&&"random"!==o&&"custom"!==o&&("all"==e||o==e))for(var r in a[o])if(a[o].hasOwnProperty(r)&&"icon"!==r&&(""+t=="undefined"||t.indexOf(r)>=0))for(var s in a[o][r])a[o][r].hasOwnProperty(s)&&-1==jQuery.inArray(a[o][r][s].title,["*north*","*south*","*east*","*west*"])&&i.randomSlideAnimCache[e][t].push(s);return i.randomSlideAnimCache[e][t][Math.floor(Math.random()*i.randomSlideAnimCache[e][t].length)]},cbgW:function(e,t){return _R_is_Editor?RVS.RMD.width:"carousel"===i[e].sliderType?i[e].justifyCarousel?i[e].carousel.slide_widths[void 0!==t?t:i[e].carousel.focused]:i[e].carousel.slide_width:i[e].canv.width},cbgH:function(e,t){return _R_is_Editor?RVS.RMD.height:"carousel"===i[e].sliderType?!0===i[e].carousel.justify?i[e].carousel.slide_height:"fullscreen"===i[e].sliderLayout?i[e].module.height:Math.min(i[e].canv.height,i[e].gridheight[i[e].level]):void 0!==i[e].maxHeight&&i[e].maxHeight>0&&!i[e].fixedOnTop?Math.min(i[e].canv.height,i[e].maxHeight):i[e].canv.height},valBeau:function(e){return e=(""+(e=(""+(e=(""+(e=(""+(e=(""+e).split(",").join("|"))).replace("{","ran("))).replace("}",")"))).replace("[","cyc("))).replace("]",")")},animateSlide:function(e,i){return _R_is_Editor&&RVS.F.resetSlideTL(),void 0===tpGS.eases.late&&(tpGS.CustomEase.create("late","M0,0,C0,0,0.474,0.078,0.724,0.26,0.969,0.438,1,1,1,1"),tpGS.CustomEase.create("late2","M0,0 C0,0 0.738,-0.06 0.868,0.22 1,0.506 1,1 1,1 "),tpGS.CustomEase.create("late3","M0,0,C0,0,0.682,0.157,0.812,0.438,0.944,0.724,1,1,1,1")),r(e,i)},getBasic:function(e){return jQuery.extend(!0,{attr:null==e||void 0===e.attr?["o","r","sx","sy","x","y","m","e","row","col","mo","moo"]:e.attr,in:{f:"start",m:!1,o:1,r:0,sx:1,sy:1,x:0,y:0,row:1,col:1,e:"power2.inOut",ms:1e3,mo:0,moo:"none"},out:{f:"start",m:!1,o:1,r:0,sx:1,sy:1,x:0,y:0,row:1,col:1,e:"power2.inOut",ms:1e3}},e)},playBGVideo:function(e,t,a){if(_R_is_Editor)a=void 0===a?RVS.SBGS[RVS.S.slideId].n:a;else{if(void 0===a&&(void 0===i[e].pr_next_bg||0===i[e].pr_next_bg.length))return;a=void 0===a?i[e].sbgs[void 0===t?i[e].pr_next_bg[0].dataset.key:t]:a}void 0!==a.bgvid&&a.bgvid.length>0&&(c(e,{},a,"in"),i.resetVideo(a.bgvid,e),i.playVideo(a.bgvid,e,!0),tpGS.gsap.to(a.bgvid[0],.2,{zIndex:30,display:"block",autoAlpha:1,delay:.075,overwrite:"all"}))},stopBGVideo:function(e,t,a){if(_R_is_Editor)a=void 0===a?RVS.SBGS[RVS.S.slideId].n:a;else{if(void 0===a&&(void 0===i[e].pr_next_bg||0===i[e].pr_next_bg.length))return;a=void 0===a?i[e].sbgs[void 0===t?i[e].pr_next_bg[0].dataset.key:t]:a}void 0!==a.bgvid&&a.bgvid.length>0&&(a.drawVideoCanvasImagesRecall=!1,i.stopVideo(a.bgvid,e),tpGS.gsap.to(a.bgvid[0],.2,{autoAlpha:0,zIndex:0,display:"none"}))},SATools:{getOffset:function(e,t,a,o){var r=(""+e).indexOf("%")>=0;return 0==(e=i.SATools.getSpecialValue(e,o,a))||void 0===e?0:r?t*(parseInt(e)/100):parseInt(e)},getSpecialValue:function(e,t,a,o){if(i.isNumeric(parseFloat(e,0)))return parseFloat(e,0);var r=(""+e).split("ran(").length>1?"random":(""+e).split("cyc(").length>1?"wrap":(""+e).split("(").length>1?"dir":"unknown",s=("random"===r?e.slice(4,-1):"wrap"===r?e.slice(4,-1):e.slice(1,-1)).split("|");if("random"===r)return tpGS.gsap.utils.random(parseFloat(s[0]),parseFloat(s.length>1?s[1]:0-s[0]));if("wrap"===r){var n=tpGS.gsap.utils.wrap(s,t);return(""+n).split("(").length>1?parseFloat(n.slice(1,-1))*a+(o?"%":""):n}return"dir"===r?parseFloat(s[0])*a+(o?"%":""):void 0}},getmDim:function(e,t,a){var o=i.cbgW(e,t),r=i.cbgH(e,t);return a.DPR=_R_is_Editor?Math.min(window.devicePixelRatio,2):i[e].DPR,i.maxDimCheck(a,o,r)},maxDimCheck:function(e,t,a){var o,r;void 0!==e.video&&("img"===e.video.tagName||null==e.video.videoWidth||e.video.videoWidth);if("animating"!==e.currentState&&null==e.panzoom||"animating"===e.currentState&&null==e.panzoom&&(null==e.slideanimation||null==e.slideanimation.anim||"true"!==e.slideanimation.anim.adpr))if(e.DPR>1&&i.ISM&&a>1024)e.DPR=1,o=t,r=a;else{var s={w:null==e.video||e.isVidImg?e.loadobj.width:0==e.video.videoWidth?e.loadobj.width:e.video.videoWidth,h:null==e.video||e.isVidImg?e.loadobj.height:0==e.video.videoHeight?e.loadobj.height:e.video.videoHeight};void 0===s.w&&(s.w=e.loadobj.width),void 0===s.h&&(s.h=e.loadobj.height);var n=a/s.w,d=t/s.h,l=Math.max(n,d);if(l>e.DPR||n>=1&&d>=1?e.DPR=1:e.DPR>l&&(e.DPR=Math.min(e.DPR,e.DPR/l)),o=t*e.DPR,r=a*e.DPR,e.DPR>1){var c=t/a;s.w>s.h&&s.ws.w&&s.ht.fps){t.then=t.now-t.elapsed%t.fps;var o="img"===t.video.tagName||null==t.video.videoWidth||0==t.video.videoWidth;void 0!==t.video&&!t.video.BGrendered&&void 0!==t.loadobj&&void 0!==t.loadobj.img||i.ISM&&i.isFirefox(e)?(t.mDIM=i.getmDim(e,t.skeyindex,t),t.pDIMS=s(t.mDIM,t,{width:t.mDIM.width,height:t.mDIM.height,x:0,y:0,contw:t.loadobj.width,conth:t.loadobj.height}),t.shadowCanvas.width!==t.mDIM.width&&(t.shadowCanvas.width=t.mDIM.width),t.shadowCanvas.height!==t.mDIM.height&&(t.shadowCanvas.height=t.mDIM.height),t.shadowCTX.drawImage(t.loadobj.img,t.pDIMS.x,t.pDIMS.y,t.pDIMS.width,t.pDIMS.height)):((a||void 0===t.sDIMS||o!==t.isVidImg||0===t.sDIMS.width||0===t.sDIMS.height)&&(t.isVidImg=o,t.mDIM=i.getmDim(e,t.skeyindex,t),t.sDIMS=s(t.mDIM,t,{width:t.mDIM.width,height:t.mDIM.height,x:0,y:0,contw:t.isVidImg?t.loadobj.width:t.video.videoWidth,conth:t.isVidImg?t.loadobj.height:t.video.videoHeight})),void 0!==t.sDIMS&&0!==t.sDIMS.width&&0!==t.sDIMS.height&&("animating"===t.currentState?(t.shadowCanvas.width!==t.mDIM.width&&(t.shadowCanvas.width=t.mDIM.width),t.shadowCanvas.height!==t.mDIM.height&&(t.shadowCanvas.height=t.mDIM.height),t.shadowCTX.drawImage(t.video,t.sDIMS.x,t.sDIMS.y,t.sDIMS.width,t.sDIMS.height)):void 0===t.animateDirection&&(t.canvas.width!==t.mDIM.width&&(t.canvas.width=t.mDIM.width),t.canvas.height!==t.mDIM.height&&(t.canvas.height=t.mDIM.height),t.ctx.drawImage(t.video,t.sDIMS.x,t.sDIMS.y,t.sDIMS.width,t.sDIMS.height)),t.shadowCanvas_Drawn=!0))}(a||t.drawVideoCanvasImagesRecall&&"animating"===t.currentState||"animating"===t.currentState&&void 0===t.shadowCanvas_Drawn)&&window.requestAnimationFrame(function(){i.updateVideoFrames(e,t)})},createOverlay:function(e,t,a,o){if("none"===t)return"none";a=void 0===a?1:a;o=void 0===o?{0:"rgba(0, 0, 0, 0)",1:"rgba(0, 0, 0, 1)"}:o;var r={none:[[0]],1:[[1,0],[0,0]],2:[[1,0,0],[0,0,0],[0,0,0]],3:[[1,0,0,0],[0,0,0,0],[0,0,0,0]],4:[[1],[0]],5:[[1],[0],[0]],6:[[1],[0],[0],[0]],7:[[1,0]],8:[[1,0,0]],9:[[1,0,0,0]],10:[[1,0,0,0,0],[0,1,0,1,0],[0,0,0,0,0],[0,1,0,1,0],[0,0,0,0,1]],11:[[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0]],12:[[1,0,0],[0,1,0],[0,0,1]],13:[[0,0,1],[0,1,0],[1,0,0]],14:[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,0]],15:[[0,0,0,0,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,0,0,0,0]],16:[[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1]]},s=void 0===r[t=void 0===t?1:t]?r[2]:r[t];_R_is_Editor&&(i[e]=void 0===i[e]?{}:i[e]),i[e].patternCanvas=document.createElement("canvas"),i[e].patternCtx=i[e].patternCanvas.getContext("2d"),i[e].patternCanvas.width=s[0].length*a,i[e].patternCanvas.height=s.length*a;for(var n=0;n=0)&&(void 0===t.loadobj||!0!==t.loadobj.useBGColor),_R_is_Editor&&void 0===t.panzoom&&delete t.shadowCanvas,void 0===t.shadowCanvas&&(t.shadowCanvas=document.createElement("canvas"),t.shadowCTX=t.shadowCanvas.getContext("2d"),t.shadowCanvas.style.background="transparent",t.shadowCanvas.style.opacity=1),!0===t.replaceShadowCanvas||!0===t.loadobj.bgColor||!0===t.usebgColor||void 0!==t.panzoom||null!=t.isHTML5&&1!=t.poster||t.usepattern?(o={width:t.mDIM.width,height:t.mDIM.height,x:0,y:0},t.usepattern&&void 0!==t.loadobj&&void 0!==t.loadobj.img?i.getCanvasPattern(e,t,{ratio:t.loadobj.height/t.loadobj.width}):(t.loadobj.bgColor||t.usebgColor)&&(t.shadowCanvas.width!==t.mDIM.width&&(t.shadowCanvas.width=t.mDIM.width),t.shadowCanvas.height!==t.mDIM.height&&(t.shadowCanvas.height=t.mDIM.height),i.getCanvasGradients(e,t))):(o=s(t.mDIM,t,{width:t.mDIM.width,height:t.mDIM.height,x:0,y:0,contw:t.loadobj.width,conth:t.loadobj.height}),t.shadowCanvas.width!==t.mDIM.width&&(t.shadowCanvas.width=t.mDIM.width),t.shadowCanvas.height!==t.mDIM.height&&(t.shadowCanvas.height=t.mDIM.height),void 0!==t.loadobj&&void 0!==t.loadobj.img&&t.shadowCTX.drawImage(t.loadobj.img,o.x,o.y,o.width,o.height),o={width:t.mDIM.width,height:t.mDIM.height,x:0,y:0}),o},getCanvasPattern:function(e,t,a){void 0===t.patternImageCanvas&&(t.patternImageCanvas=document.createElement("canvas"),t.patternImageCTX=t.patternImageCanvas.getContext("2d"));var o=t.bgfit.split(" ");1===o.length&&(o[1]=o[0]),a.width="auto"===o[0]?t.loadobj.width:t.loadobj.width*(parseInt(o[0],0)/100),a.height="auto"===o[1]?t.loadobj.height:a.width*a.ratio,t.DPR=_R_is_Editor?Math.min(window.devicePixelRatio,2):i[e].DPR;var r=a.width/a.height;a.width=a.width*t.DPR,a.height=a.height*t.DPR,i.isIOS&&a.width*a.height>15728640&&(t.mDIM.width>t.mDIM.height?(a.width=t.mDIM.width,a.height=Math.round(t.mDIM.width/r)):(a.height=t.mDIM.height,a.width=Math.round(t.mDIM.height*r))),t.patternImageCanvas.width=a.width,t.patternImageCanvas.height=a.height,t.patternImageCTX.drawImage(t.loadobj.img,0,0,a.width,a.height),t.shadowCanvas.width!==t.mDIM.width&&(t.shadowCanvas.width=t.mDIM.width),t.shadowCanvas.height!==t.mDIM.height&&(t.shadowCanvas.height=t.mDIM.height),t.shadowCTX.clearRect(0,0,t.shadowCTX.canvas.width,t.shadowCTX.canvas.height),t.pattern=t.shadowCTX.createPattern(t.patternImageCanvas,t.bgrepeat),t.shadowCTX.fillStyle=t.pattern,t.shadowShifts={h:t.bgposition.split(" ")[0],v:t.bgposition.split(" ")[1]},t.shadowShifts.hperc=i.isNumeric(parseInt(t.shadowShifts.h))?parseInt(t.shadowShifts.h)/100*t.mDIM.width:0,t.shadowShifts.vperc=i.isNumeric(parseInt(t.shadowShifts.v))?parseInt(t.shadowShifts.v)/100*t.mDIM.height:0,t.shadowShifts.x="left"===t.shadowShifts.h?0:"center"===t.shadowShifts.h||"50%"==t.shadowShifts.h?"repeat"==t.bgrepeat||"repeat-x"==t.bgrepeat?t.mDIM.width/2-a.width/2-Math.ceil(t.mDIM.width/2/a.width)*a.width:t.mDIM.width/2-a.width/2:"right"===t.shadowShifts.h?"repeat"==t.bgrepeat||"repeat-x"==t.bgrepeat?-(a.width-t.mDIM.width%a.width):t.mDIM.width-a.width:"repeat"==t.bgrepeat||"repeat-x"==t.bgrepeat?-(a.width-t.shadowShifts.hperc%a.width):t.shadowShifts.hperc,t.shadowShifts.y="top"===t.shadowShifts.v?0:"center"===t.shadowShifts.v||"50%"==t.shadowShifts.v?"repeat"==t.bgrepeat||"repeat-y"==t.bgrepeat?t.mDIM.height/2-a.height/2-Math.ceil(t.mDIM.height/2/a.height)*a.height:t.mDIM.height/2-a.height/2:"bottom"===t.shadowShifts.v?"repeat"==t.bgrepeat||"repeat-y"==t.bgrepeat?-(a.height-t.mDIM.height%a.height):t.mDIM.height-a.height:"repeat"==t.bgrepeat||"repeat-y"==t.bgrepeat?-(a.height-t.shadowShifts.vperc%a.height):t.shadowShifts.vperc,t.shadowCTX.save(),t.shadowCTX.translate(t.shadowShifts.x,t.shadowShifts.y),t.shadowCTX.fillRect(0,0,t.mDIM.width-t.shadowShifts.x,t.mDIM.height-t.shadowShifts.y),t.shadowCTX.restore()},getCanvasGradients:function(e,t){if(t.bgcolor.indexOf("gradient")>=0){t.gradient=null==t.gradient||_R_is_Editor?i.getGradients(t.bgcolor):t.gradient,t.shadowGrd="radialGradient"===t.gradient.type?t.shadowCTX.createRadialGradient(t.mDIM.width/2,t.mDIM.height/2,0,t.mDIM.width/2,t.mDIM.height/2,Math.max(t.mDIM.width/2,t.mDIM.height/2)):i.calcLinearGradient(t.shadowCTX,t.shadowCanvas.width,t.shadowCanvas.height,t.gradient.deg);for(var a=0;a3?n[3]:1}}),d.appendChild(s);i.gradSVG.appendChild(d),e="url(#tp_svg_gradient_"+i.svgGradients.length+")",i.svgGradients.push({url:e,src:o,g:d})}return e},getGradients:function(e){return e.indexOf("radial-gradient")>=0?{stops:i.getGradientColorStopPoints(e.split("radial-gradient(ellipse at center, ")[1]),type:"radialGradient",deg:0}:-1!==e.indexOf("gradient")?i.getLinearGradientStops(e):e},getLinearGradientStops:function(e){var i=e.split("linear-gradient(")[1];_R_is_Editor&&(i=(i=i.split(", ").join(",")).split(",rgba").join(", rgba"));var t=i.split("deg, ");for(var a in i=(t.length>1?t[1]:t[0]).split(" "),t=t.length>1?t[0]:180,i)i.hasOwnProperty(a)&&i[a].indexOf("%")>=0&&(i[a]=""+Math.round(100*parseFloat(i[a].split("%,")[0].split("%)")[0]))/1e4);return{stops:i,deg:t,type:"linearGradient"}},getGradientColorStopPoints:function(e){var i=/rgb([\s\S]*?)%/g,t=[],a=[];do{(r=i.exec(e))&&t.push(r[0])}while(r);for(var o=0;op(d,l,v[1].x,v[1].y)?(o=v[0].x,r=v[0].y):(o=v[1].x,r=v[1].y),p(d,l,v[2].x,v[2].y)>p(d,l,v[3].x,v[3].y)?(s=v[2].x,n=v[2].y):(s=v[3].x,n=v[3].y),Math.round(100*Math.atan2(l-r,d-o))/100===Math.round(a%(2*Math.PI)*100)/100){var w=o,y=r;o=s,r=n,s=w,n=y}return e.createLinearGradient(Math.round(o),Math.round(r),Math.round(s),Math.round(n))},transitions:{filter:{update:function(e,i,t){if(void 0!==e&&void 0!==e.tl){var a=void 0!==t||void 0!==e.tl.blur?" blur("+(void 0!==t?t:0+e.tl.blur!==void 0?e.tl.blur:0)+"px)":"";i.canvas.style.filter=void 0===e.tl.filter?""+a:e.tl.filter+a}},extendTimeLine:function(e,i,t){if(null!=i){var a=void 0!==i.g&&"0%"!==i.g&&0!==i.g?(""===a?"":" ")+"grayscale(_g_%)":"";a+=void 0!==i.h&&"100%"!==i.h&&100!==i.h?(""===a?"":" ")+"brightness(_h_%)":"",a+=void 0!==i.s&&"0px"!==i.s&&0!==i.s?(""===a?"":" ")+"sepia(_s_%)":"",a+=void 0!==i.c&&100!==i.c?(""===a?"":" ")+"contrast(_c_%)":"",""!==(a+=void 0!==i.i&&0!==i.i?(""===a?"":" ")+"invert(_i_%)":"")&&(i.tl={filter:a.replace("_g_",parseFloat(i.g)).replace("_h_",parseFloat(i.h)).replace("_s_",parseFloat(i.s)).replace("_c_",parseFloat(i.c)).replace("_i_",parseFloat(i.i))}),void 0!==i.b&&"0px"!==i.b&&0!==i.b&&(void 0===i.tl?i.tl={blur:parseFloat(i.b)}:i.tl.blur=parseFloat(i.b)),void 0!==i.tl&&(e.add(tpGS.gsap.to(i.tl,i.ms/i.sec,void 0===i.tl.filter?{blur:0}:void 0===i.tl.blur?{filter:a.replace("_g_","0").replace("_h_","100").replace("_s_","0").replace("_c_",100).replace("_i_",0),ease:i.e}:{blur:0,filter:a.replace("_g_","0").replace("_h_","100").replace("_s_","0").replace("_c_",100).replace("_i_",0),ease:i.e}),0),t.canvasFilter=!0)}}},slidingoverlay:{getBasic:function(){return i.getBasic({attr:["x","y"],in:{m:!0,o:-1,_xy:20,_gxys:10,_gxye:-10,zIndex:20,e:"power1.inOut"},out:{m:!0,reversed:!1,_xy:-100,o:0,zIndex:10,e:"power1.inOut"}})},updateAnim:function(e,t,a){var o=void 0!==t.in.x&&0!==t.in.x&&"0%"!==t.in.x?"x":"y";t.in["g"+o+"s"]=i.SATools.getOffset(t.in[o],t.in._gxys,a,1)+"%",t.in["g"+o+"e"]=i.SATools.getOffset(t.in[o],t.in._gxye,a,1)+"%",t.out[o]=i.SATools.getOffset(t.in[o],t.out._xy,a,1)+"%",t.in[o]=i.SATools.getOffset(t.in[o],t.in._xy,a,1)+"%";var r=parseInt(t.in[o])>=0;return t.in.d="x"===o?r?"left":"right":r?"up":"down",t},beforeDraw:function(e,i,t,a){void 0!==t.d&&(t._dxs="right"===t.d?0+t.mw:"left"===t.d?0-t.mw:0,t._dys="down"===t.d?0+t.mh:"up"===t.d?0-t.mh:0,t._xs="left"===t.d?0-t.mw:0,t._ys="up"===t.d?0-t.mh:0,t._xe="right"===t.d?a.SLOT.OW+t.mw:"left"===t.d?a.SLOT.OW-t.mw:a.SLOT.OW,t._ye="down"===t.d?a.SLOT.OH+t.mh:"up"===t.d?a.SLOT.OH-t.mh:a.SLOT.OH,i.beginPath(),i.rect("left"===t.d?Math.max(0,t._xs):"right"===t.d?Math.min(0,t._xs):0,"up"===t.d?Math.max(0,t._ys):"down"===t.d?Math.min(0,t._ys):0,"left"===t.d?Math.max(a.SLOT.OW,t._xe):"right"===t.d?Math.min(a.SLOT.OW,t._xe):t._xe,"up"===t.d?Math.max(a.SLOT.OH,t._ye):"down"===t.d?Math.min(a.SLOT.OH,t._ye):t._ye),i.clip())},afterDraw:function(e,i,t,a,o){void 0!==t.d&&(i.save(),i.beginPath(),i.rect(Math.max(0,t._dxs),Math.max(0,t._dys),t._xe,t._ye),i.clip(),i.save(),i.transform(o.csx,o.ssx,o.ssy,o.csy,.5*a.SLOT.OW+t.x+t.sgx,.5*a.SLOT.OH+t.y+t.sgy),i.drawImage(void 0!==a.shadowCanvas?a.shadowCanvas:a.loadobj.img,0,0,a.SLOT.OW,a.SLOT.OH,t.sgx-a.SLOT.OW/2,t.sgy-a.SLOT.OH/2,a.SLOT.OW,a.SLOT.OH),i.restore(),i.fillStyle="rgba(0,0,0,0.6)",i.fillRect(t.gx,t.gy,a.SLOT.OW,a.SLOT.OH),i.restore())},extendTimeLine:function(e,t,a,o,r,s){"in"!==r.direction||void 0===o.gxe&&void 0===o.gye||(jQuery.extend(!0,a[0],{d:o.d,gx:void 0===o.gxs?0:2*i.SATools.getOffset(o.gxs,s.width,r.sdir,0),gy:void 0===o.gys?0:2*i.SATools.getOffset(o.gys,s.height,r.sdir,0),sgx:void 0===o.gxs?0:i.SATools.getOffset(o.gxs,s.width,r.sdir,0),sgy:void 0===o.gys?0:i.SATools.getOffset(o.gys,s.height,r.sdir,0),mw:0-s.width,mh:0-s.height}),t.add(tpGS.gsap.to(a,o.ms/o.sec,{gx:void 0===o.gxe?0:2*i.SATools.getOffset(o.gxe,s.width,r.sdir,0),gy:void 0===o.gye?0:2*i.SATools.getOffset(o.gye,s.height,r.sdir,0),sgx:void 0===o.gxe?0:2*i.SATools.getOffset(o.gxe,s.width,r.sdir,0),sgy:void 0===o.gye?0:2*i.SATools.getOffset(o.gye,s.height,r.sdir,0),mw:s.width,mh:s.height,ease:o.e}),0))}},motionFilter:{init:function(e,i){return void 0!==i&&parseFloat(i)>0?(i=parseFloat(i),e.fmExists=!0,e.fmShadow=void 0===e.fmShadow?document.createElement("canvas"):e.fmShadow,e.fmCtx=e.fmShadow.getContext("2d"),e.fmShadow.width=e.ctx.canvas.width,e.fmShadow.height=e.ctx.canvas.height,e.fmCtx.globalAlpha=tpGS.gsap.utils.mapRange(100,0,40,0,i)/100,e.fmCtx.clearRect(0,0,e.ctx.canvas.width,e.ctx.canvas.height)):e.fmExists=!1,i},render:function(e,i){"partial"===i&&(e.fmCtx.globalCompositeOperation="source-over"),e.fmCtx.drawImage(e.canvas,0,0,e.canvas.width,e.canvas.height),e.ctx.clearRect(0,0,e.canvas.width,e.canvas.height),e.ctx.drawImage(e.fmCtx.canvas,0,0,e.canvas.width,e.canvas.height),"partial"===i&&(e.fmCtx.globalCompositeOperation="source-atop"),"partial"!==i&&"full"!==i||(e.fmCtx.fillStyle="rgba(255, 255, 255, 0.1)",e.fmCtx.fillRect(0,0,e.canvas.width,e.canvas.height))},clearFull:function(e,i){e.fmExists&&void 0!==e.fmCtx&&(e.ctx.clearRect(0,0,e.canvas.width,e.canvas.height),e.fmCtx.clearRect(0,0,e.canvas.width,e.canvas.height),void 0!==i&&i.render(i.time(),!0,!0))},complete:function(e){e.fmShadow&&e.fmShadow.remove()}},d3:{ticker:function(e,i,t){if(void 0!==e.helper){var a=e.smi*("in"===t?e.helper.oo:e.helper.o),o=e.sma*("in"===t?e.helper.oo:e.helper.o);if(e.gradient="vertical"===e.d?"in"===t?i.ctx.createLinearGradient(0,0,0,i.canvas.height):i.ctx.createLinearGradient(0,i.canvas.height,0,0):"in"===t?i.ctx.createLinearGradient(0,0,i.canvas.width,0):i.ctx.createLinearGradient(i.canvas.width,0,0,0),e.gradient.addColorStop(0,"rgba("+e.sc+","+a+")"),e.gradient.addColorStop(e.sl,"rgba("+e.sc+","+o+")"),i.ctx.fillStyle=e.gradient,i.ctx.fillRect(0,0,i.canvas.width,i.canvas.height),void 0!==i.cube&&i.cube.ctx){var r=void 0!==e.roomhelper&&!1!==e.roomhelper&&(90-e.roomhelper.r)/90;a=!1!==r?r:e.smi*e.helper.o,o=!1!==r?r:e.sma*e.helper.o,i.cube.ctx.clearRect(0,0,i.cube.ctx.canvas.width,i.cube.ctx.canvas.height),e.gradientW=!1!==r?"vertical"===e.d?e.t<0&&1===e.sdir||e.t>0&&-1===e.sdir?i.ctx.createRadialGradient(0,i.cube.ctx.canvas.width/2,0,0,0,2*i.cube.ctx.canvas.width):i.ctx.createRadialGradient(i.cube.ctx.canvas.width,0,0,0,0,2*i.cube.ctx.canvas.width):e.t>0&&1===e.sdir||e.t<0&&-1===e.sdir?i.ctx.createRadialGradient(i.cube.ctx.canvas.width/2,i.cube.ctx.canvas.height,0,i.cube.ctx.canvas.width/2,i.cube.ctx.canvas.height,i.cube.ctx.canvas.width):i.ctx.createRadialGradient(i.cube.ctx.canvas.width/2,.2*i.cube.ctx.canvas.height,0,i.cube.ctx.canvas.width/2,.2*i.cube.ctx.canvas.height,i.cube.ctx.canvas.width):"vertical"===e.d?i.ctx.createLinearGradient(0,0,0,i.cube.ctx.canvas.height):i.ctx.createLinearGradient(0,0,i.cube.ctx.canvas.width,0),e.gradientW.addColorStop(0,"rgba("+e.sc+","+(!1!==r?"a"===e.DIR?o:0:"a"===e.DIR?0:o)+")"),e.gradientW.addColorStop(1,"rgba("+e.sc+","+(!1!==r?"a"===e.DIR?0:o:"a"===e.DIR?o:0)+")"),i.cube.ctx.fillStyle=e.gradientW,i.cube.ctx.fillRect(0,0,i.cube.ctx.canvas.width,i.cube.ctx.canvas.height)}}},setWall:function(e,i,t,a,o,r){return e.TL=tpGS.gsap.timeline(),e.TL.add(tpGS.gsap.to(e.c,.2,{display:"block"}),0),"rotationX"===t?(e.ctx.canvas.width=a.w,e.ctx.canvas.height=a.w,e.TL.add(tpGS.gsap.set(e.w,{backgroundColor:o,width:a.w,height:a.w,transformOrigin:"50% 50% -"+a.w/2+"px",x:0,y:i>0?-(a.w-a.h):0,rotationX:i>0?-90:90,rotationY:0}),0)):(e.ctx.canvas.width=r?a.w:a.h,e.ctx.canvas.height=a.h,e.TL.add(tpGS.gsap.set(e.w,{backgroundColor:o,width:r?a.w:a.h,height:a.h,transformOrigin:"50% 50% -"+(r?a.w:a.h)/2+"px",x:i<0?a.w-a.h:0,y:0,rotationX:0,rotationY:i>0?-90:90}),0)),e.TL},buildCube:function(e){e.cube={c:document.createElement("div"),w:document.createElement("canvas")},e.cube.ctx=e.cube.w.getContext("2d"),e.cube.c.className="rs_fake_cube",e.cube.w.className="rs_fake_cube_wall",tpGS.gsap.set(e.cube.c,{width:e.mDIM.w,height:e.mDIM.h}),tpGS.gsap.set(e.cube.w,{width:e.mDIM.w,height:e.mDIM.h,backgroundColor:"#ccc"}),e.cube.c.appendChild(e.cube.w),e.sbg.appendChild(e.cube.c)},cubeTL:function(e,t,a,o){if("none"!==t.f&&void 0!==t.f){a.sbg.style.transformStyle="preserve-3d";var r=tpGS.gsap.timeline(),s="incube"===t.f?1:-1,n="incube"===t.f||"cube"===t.f,d="fly"===t.f?-30:90,l="turn"!==t.f&&!1!==t.t&&(_R_is_Editor||!0===i[e].firstSlideAnimDone),c=-1*t.z,p={},g={z:l?0:c,ease:"power1.inOut"},u={ease:t.e},h=[a.canvas],m=n?"50% 50% ":"20% 20% ",v="rotationX",f="rotationY",w="y",y="height",b=t.fd;if("vertical"!==t.d?(v="rotationY",f="rotationX",w="x",y="width",t.DIR=1===t.sdir?"b":"a"):t.DIR=1===t.sdir?"a":"b",y="width"===y?"w":"height"===y?"h":y,"turn"===t.f?(d="vertical"===t.d?-120:120,m="vertical"===t.d?1===t.sdir?"in"===o?"0% 0% 0%":"0% 100% 0%":"in"===o?"0% 100% 0%":"0% 0% 0%":1===t.sdir?"in"===o?"0% 0% 0%":"100% 0% 0%":"in"===o?"100% 0% 0%":"0% 0% 0%",g.z=0,u.ease="out"===o?"power3.out":u.ease,b="out"===o?b/2:b):m+=s*a.mDIM[y]/2+"px",u[v]=0,u[w]=0,"in"===o?p[v]=d*t.sdir:u[v]=-d*t.sdir,"fly"===t.f){var _=void 0===t.fz?20*Math.random()-10:parseInt(t.fz);"in"===o?(p[w]=a.mDIM[y]*(void 0===t.fdi?1.5:parseFloat(t.fdi))*t.sdir,p.rotateZ=t.sdir*_,u.rotateZ=0):(u[w]=a.mDIM[y]*(void 0===t.fdo?2:parseFloat(t.fdo))*t.sdir*-1,u.rotateZ=t.sdir*_*-1)}if(a.sbg.style.perspective=l?"2500px":"1500px",l){var S={z:c*("fly"===t.f?1.5:3),ease:"power1.inOut"},x={z:0,ease:"power1.inOut"};S[f]=-1*t.t,x[f]=0,t.roomhelper={r:0},r.add(tpGS.gsap.set(_R_is_Editor?RVS.SBGS[RVS.S.slideId].wrap:a.wrap[0],{perspective:1200,transformStyle:"preserve-3d",transformOrigin:m}),0),r.add(tpGS.gsap.to(a.sbg,3*t.md,S),0),r.add(tpGS.gsap.to(a.sbg,3*t.md,x),b-t.md),r.add(tpGS.gsap.to(t.roomhelper,3*t.md,{r:Math.abs(t.t)}),0),r.add(tpGS.gsap.to(t.roomhelper,3*t.md,{r:0}),b-t.md),"in"===o&&1!==s&&n&&(void 0===a.cube&&i.transitions.d3.buildCube(a),r.add(i.transitions.d3.setWall(a.cube,S[f],f,a.mDIM,t.c),0),h.push(a.cube.c))}else t.roomhelper=!1,r.add(tpGS.gsap.set(_R_is_Editor?RVS.SBGS[RVS.S.slideId].wrap:a.wrap[0],{perspective:"none",transformStyle:"none",transformOrigin:"50% 50%"}),0),!_R_is_Editor&&!0!==i[e].firstSlideAnimDone&&n&&(void 0===a.cube&&i.transitions.d3.buildCube(a),r.add(i.transitions.d3.setWall(a.cube,p[v],v,a.mDIM,t.c,!0),0),r.add(tpGS.gsap.fromTo(a.cube.w,4*t.md,{opacity:0},{opacity:1}),0),h.push(a.cube.c));return t.helper={o:0,oo:1},r.add(tpGS.gsap.to(t.helper,b,{o:1,oo:0,ease:t.e}),t.md+0),r.add(tpGS.gsap.set(h,jQuery.extend(!0,{},p,{force3D:!0,transformOrigin:m})),0),"turn"!==t.f&&r.add(tpGS.gsap.to(h,3*t.md,g),0),r.add(tpGS.gsap.to(h,b,u),t.md+0),"turn"!==t.f&&r.add(tpGS.gsap.to(h,3*t.md,{z:0,ease:"power1.inOut"}),b-t.md),"out"===o&&1!==s&&r.add(tpGS.gsap.to(h,2*t.md,{opacity:0}),t.dur-2*t.md),r}}}},animatedCanvasUpdate:function(e,t){t.cDIMS=i.getBGCanvasDetails(e,t),t.canvas.style.backgroundColor="transparent",t.canvas.style.opacity=1,t.canvas.width!==t.mDIM.width&&(t.canvas.width=t.mDIM.width),t.canvas.height!==t.mDIM.height&&(t.canvas.height=t.mDIM.height),_R_is_Editor||!0!==i[e].clearModalBG||(t.ctx.clearRect(0,0,t.canvas.width,t.canvas.height),i[e].clearModalBG=!1,t.sbg.parentNode.style.opacity=1),t.col=t.col||1,t.row=t.row||1,t.SLOT=jQuery.extend(!0,{s:{},c:{}},a(e,t.col,t.row,t.mDIM,"OW","OH")),t.SLOT.DX=0-t.SLOT.OW/2,t.SLOT.DY=0-t.SLOT.OH/2,t.row=Math.ceil(t.mDIM.height/t.SLOT.OH)||1,void 0!==t.callFromAnimatedCanvasUpdate&&t.callFromAnimatedCanvasUpdate()},slideAnimFinished:function(e,t,a,o){void 0!==t&&(void 0!==t.bgvid&&t.bgvid.length>0&&"out"===a.direction&&(t.drawVideoCanvasImagesRecall=!1,i.stopVideo(t.bgvid,e),t.bgvid[0].style.display="none",t.bgvid[0].style.zIndex=0),t.panFake&&t.panFake.img&&("out"===a.direction?t.panFake.img.style.display="none":t.panFake.img.style.display="block"),"in"===a.direction&&(i.transitions.motionFilter.complete(t),t.ctx.canvas.style.filter="none",tpGS.gsap.set(a.slide,{zIndex:20}),delete t.animateDirection,t.bgvid.length>0&&(t.isHTML5?tpGS.gsap.set(t.bgvid[0],{zIndex:30,display:"block",opacity:1}):(i.resetVideo(t.bgvid,e),tpGS.gsap.delayedCall(.1,function(){i.playVideo(t.bgvid,e,!0),tpGS.gsap.set(t.bgvid[0],{zIndex:30,display:"block",opacity:1})})))),"out"===a.direction?(tpGS.gsap.set(a.slide,{zIndex:10}),tpGS.gsap.set(t.canvas,{rotationX:0,rotationY:0,rotationZ:0,x:0,y:0,z:0,opacity:1}),t.currentState=void 0):t.currentState="idle",void 0!==t.cube&&(t.cube.c.style.display="none"),"in"===a.direction&&(i.updateSlideBGs(e,t.skeyindex,t),void 0===t.panzoom||_R_is_Editor||i.startPanZoom(i[e].pr_next_bg,e,void 0!==i[e].panzoomTLs[t.skeyindex]?i[e].panzoomTLs[t.skeyindex].progress():0,t.skeyindex,"play",t.key),void 0!==a.BG&&!0!==o&&a.BG.ctx.clearRect(0,0,2*t.canvas.width,2*t.canvas.height)))},animateCore:function(e,t,a,o){var r,s,n,d,l=t.canvas,c=t.ctx,p=0;if(t.col=a.col,t.row=a.row,_R_is_Editor&&t.three){for(t.canvas.style.display="block";t.three.scene.children.length>0;)t.three.scene.remove(t.three.scene.children[0]);t.three.canvas.parentNode.removeChild(t.three.canvas),t.three=void 0}i.animatedCanvasUpdate(e,t),a.row=t.row,t.animateDirection=o.direction,o.delay=void 0===o.delay?0:o.delay,n=a.col*a.row,d=Array(n),void 0===t.help_canvas&&"out"===o.direction&&void 0!==o.bgColor&&(t.help_canvas=document.createElement("canvas"),t.help_ctx=t.help_canvas.getContext("2d")),"out"===o.direction&&void 0!==o.bgColor&&(t.help_canvas.width=t.mDIM.width,t.help_canvas.height=t.mDIM.height,t.help_ctx.fillStyle=o.bgColor,t.help_ctx.fillRect(0,0,t.mDIM.width,t.mDIM.height)),a.mo=i.transitions.motionFilter.init(t,a.mo),a.dur=a.ms/a.sec,void 0!==o.d3&&(o.d3.dur=a.dur,o.d3.fd=.7*a.dur,o.d3.md=.15*a.dur,o.d3.sdir=o.sdir),t.SLOT.c={ws:0,hs:0,wd:0,hd:0},a.mo>0&&_R_is_Editor&&c.clearRect(0,0,l.width,l.height);var g=tpGS.gsap.timeline({onUpdate:function(){if(p=0,a.mo>0?i.transitions.motionFilter.render(t,a.moo):c.clearRect(0,0,l.width,l.height),t.help_canvas&&"out"===o.direction&&c.drawImage(t.help_canvas,0,0),(o.filter&&o.filter.u||!_R_is_Editor)&&i.transitions.filter.update(o.filter,c,t.canvasFilterBlur),_R_is_Editor&&0!==a.zIndex&&void 0!==a.zIndex&&tpGS.gsap.set(o.slide,{zIndex:a.zIndex}),void 0!==t.shadowCanvas)for(r=0;r1&&t.SLOT.SH>1&&c.drawImage(t.shadowCanvas,t.SLOT.SX,t.SLOT.SY,t.SLOT.SW,t.SLOT.SH,t.SLOT.DX,t.SLOT.DY,t.SLOT.DW,t.SLOT.DH),c.restore(),i.transitions[o.effect]&&i.transitions[o.effect].afterDraw&&i.transitions[o.effect].afterDraw(e,c,d[p],t,{csx:g,csy:u,ssx:h,ssy:m}),p++}void 0!==o.d3&&o.d3.su&&i.transitions.d3.ticker(o.d3,t,o.direction),t.currentState="animating"},onComplete:function(){i.slideAnimFinished(e,t,o)}});if(a.col*a.row<2&&(a.f="start"),0!==a.zIndex&&void 0!==a.zIndex&&g.add(tpGS.gsap.set(o.slide,{zIndex:parseInt(a.zIndex,0)}),0),a.m="false"!=a.m&&!1!==a.m,"in"===o.direction){for(r=0;r0&&void 0!==i[e].pr_next_bg[0],l=!!_R_is_Editor||void 0!==i[e].pr_active_bg&&i[e].pr_active_bg.length>0&&void 0!==i[e].pr_active_bg[0],p=_R_is_Editor?RVS.SBGS[RVS.S.slideId].n:d?i[e].sbgs[i[e].pr_next_bg[0].dataset.key]:void 0,g=_R_is_Editor?RVS.SBGS[RVS.S.slideId].c:l?i[e].sbgs[i[e].pr_active_bg[0].dataset.key]:void 0;s=1===s?-1:1,_R_is_Editor||(delete i[e].sc_indicator,delete i[e].sc_indicator_dir),r=jQuery.extend(!0,{},function(e,a,r){var s=void 0!==i.transitions[a.anim.e]&&void 0!==i.transitions[a.anim.e].getBasic?i.transitions[a.anim.e].getBasic():i.getBasic(),n="";s.out=null==s.out?{}:s.out,s.out.reversed=void 0===a.out&&(void 0===s.out.reversed||s.out.reversed);void 0!==a.iw&&parseInt(a.iw,0),void 0!==a.ow&&parseInt(a.ow,0);for(var d in s.attr)n=s.attr[d],s.in[n]=t(s.in[n],a.in[n]),s.out[n]=s.out.reversed?s.in[n]:void 0===a.out?s.out[n]:t(s.out[n],a.out[n]);return s.filter=void 0!==a.filter?jQuery.extend(!0,a.filter,a.filter):s.filter,i.transitions[a.anim.e]&&i.transitions[a.anim.e].updateAnim&&(s=i.transitions[a.anim.e].updateAnim(e,s,r)),s.e=a.anim.e,void 0!==s.in&&(s.in.col="random"===s.in.col?tpGS.gsap.utils.random(1,10,1):o(s.in.col),s.in.row="random"===s.in.row?tpGS.gsap.utils.random(1,10,1):o(s.in.row)),void 0!==s.out&&(s.out.col="random"===s.out.col?tpGS.gsap.utils.random(1,10,1):o(s.out.col),s.out.row="random"===s.out.row?tpGS.gsap.utils.random(1,10,1):o(s.out.row)),s}(e,a,s)),void 0!==p.random&&void 0!==i.SLTR&&void 0!==g&&(delete g.help_canvas,delete g.help_ctx),r.ms=t(void 0,void 0===a.anim.ms?1e3:a.anim.ms),r.f=t(void 0,a.anim.f),r.p=t(void 0,a.anim.p),r.d=t(void 0,a.anim.d),r.o=a.anim.o,void 0!==a.d3&&(a.d3.t=void 0!==a.d3.t&&0!==a.d3.t&&a.d3.t,a.d3.su="true"==a.d3.su||1==a.d3.su,a.d3.su&&(a.d3.smi=void 0===a.d3.smi?0:parseFloat(a.d3.smi),a.d3.sl=void 0===a.d3.sl?1:parseFloat(a.d3.sl),a.d3.sma=void 0===a.d3.sma?.5:parseFloat(a.d3.sma),a.d3.sc=void 0===a.d3.sc?"0,0,0":tpGS.gsap.utils.splitColor(a.d3.sc).join(",")),r.p="none",void 0!==r.in.row&&void 0!==r.in.col&&r.in.row*r.in.col>200&&(r.filter=void 0)),r.in.sec=void 0===r.in.sec?1e3:r.in.sec,r.in.stasec=void 0===r.in.stasec?void 0===r.d?1500:100*r.d:r.in.stasec,r.in.ms="default"===r.ms||"d"===r.ms?r.in.ms:"random"===r.ms?Math.round(1e3*Math.random()+300):null!=r.ms?parseInt(r.ms,0):r.in.ms,r.out.ms=r.in.ms,void 0!==r.filter&&(r.filter.ms=r.in.ms,r.filter.sec=r.in.sec,r.filter.e=void 0===r.filter.e||"default"===r.filter.e?r.in.e:r.filter.e),r.in.f=void 0===r.f||"default"===r.f||"d"===r.f?r.in.f:r.f,r.in.f="slidebased"===r.in.f?1==s?"start":"end":"oppslidebased"===r.in.f?1===s?"end":"start":r.in.f,r.out.f=r.in.f,r.out=jQuery.extend(!0,{},r.in,r.out),r.in.eng=r.out.eng=a.anim.eng,void 0!==r.out.eng&&null==i[r.out.eng]&&(r.out.o=0,r.in.o=0,r.in.ms=r.out.ms=1e3,r.in.eng=r.out.eng="animateCore"),void 0!==r.p&&"none"!==r.p&&(r.in.bg="dark"===r.p?"#000":"light"===r.p?"#fff":"transparent",r.out.delay="none"!==r.p?function(e,i){return e/2.5}:0,1===r.out.o&&0===r.out.x&&0===r.out.y&&(r.out.o=0)),"forceinout"===r.o?(r.in.zIndex=20,r.out.zIndex=10):"outin"!==r.o&&(1!==r.in.o||0!==r.in.x||0!==r.in.y||void 0===a.out||1===r.out.o&&0===r.out.x&&0===r.out.y)||(r.in.zIndex=10,r.out.zIndex=20),p.bgvid.length>0&&(r.in=c(e,r.in,p,"in")),l&&void 0!==g.bgvid&&g.bgvid.length>0&&(r.out=c(e,r.out,g,"out")),void 0!==r.out&&(r.out.simplify||r.in.simplify)&&(r.out=n(r.out)),r.in.simplify&&(r.in=n(r.in)),_R_is_Editor||requestAnimationFrame(function(){i.generalObserver(i.ISM,!0)}),r.in.eng=void 0===r.in.eng?"animateCore":r.in.eng,r.out.eng=void 0===r.out.eng?"animateCore":r.out.eng,l&&!0!==r.out.skip&&i[r.out.eng](e,g,r.out,{effect:r.e,slide:_R_is_Editor?RVS.SBGS[RVS.S.slideId].c.sbg:i[e].pr_active_slide,direction:"out",delay:0,bgColor:r.in.bg,sdir:s,filter:void 0,d3:a.d3,addOns:_R_is_Editor?a.addOns:void 0}),!0!==r.in.skip&&i[r.in.eng](e,p,r.in,{effect:r.e,slide:_R_is_Editor?RVS.SBGS[RVS.S.slideId].n.sbg:i[e].pr_next_slide,direction:"in",delay:l?"function"==typeof r.out.delay?r.out.delay(r.in.ms/1e3,r.out.row*r.out.col):r.out.delay:r.in.delay,BG:g,outslide:_R_is_Editor?RVS.SBGS[RVS.S.slideId].c.sbg:i[e].pr_active_slide,sdir:s,filter:r.filter,d3:a.d3,addOns:_R_is_Editor?a.addOns:void 0})},s=function(e,t,a){var o=e.height/e.width;if(a.ratio=a.conth/a.contw,a.ratioo&&"cover"===t.bgfit)a.height=e.width*a.ratio;else if(a.ratio>o&&"contain"===t.bgfit||a.ratio=0?parseInt(a[0],0)/100*e.width-parseInt(a[0],0)/100*t.width:parseInt(a[0],0),y:"center"===a[1]||"50%"===a[1]?(e.height-t.height)/2:"top"===a[1]?0:"bottom"===a[1]?e.height-t.height:i.isNumeric(a[1])?0:a[1].indexOf("%")>=0?parseInt(a[1],0)/100*e.height-parseInt(a[1],0)/100*t.height:parseInt(a[1],0)}}(e,a,t.bgposition);return a.x=s.x,a.y=s.y,a},n=function(e){return e.o=0,e.r=0,e.row=1,e.col=1,e.x=0,e.y=0,e.sx=1,e.sy=1,e},d=function(e){return e="false"!==e&&!1!==e&&"off"!==e&&void 0!==e&&0!==e&&-1!==e},l=function(e){var i=e.toString(16);return 1==i.length?"0"+i:i},c=function(e,t,a,o){return t.skip=!1,"in"===o?a.isHTML5?(a.bgvid[0].style.display="none",i.resetVideo(a.bgvid,e),a.animateDirection="in",a.currentState="animating",a.drawVideoCanvasImagesRecall=!0,i.updateVideoFrames(e,a,!0),i.playVideo(a.bgvid,e)):(i[e].videos[a.bgvid[0].id].pauseCalled=!1,t.waitToSlideTrans=i[e].videos[a.bgvid[0].id].waitToSlideTrans,!0!==a.poster?(i.resetVideo(a.bgvid,e),i[e].videos[a.bgvid[0].id].prePlayForaWhile=!1,!0!==t.waitToSlideTrans&&i.playVideo(a.bgvid,e,!0),tpGS.gsap.fromTo(a.bgvid,t.ms/t.sec,{zIndex:30,display:"block",opacity:0},{opacity:1,zIndex:30,display:"block"}),a.loadobj.bgColor=!0,a.bgcolor="#000",t.simplify=!0):(i[e].videos[a.bgvid[0].id].prePlayForaWhile=!1,i.resetVideo(a.bgvid,e),i.playVideo(a.bgvid,e),a.bgvid[0].style.display="none",a.bgvid[0].style.zIndex=0,a.bgvid[0].style.opacity=0)):"out"===o&&(a.isHTML5?(a.currentState="animating",a.drawVideoCanvasImagesRecall=!0,i.updateVideoFrames(e,a,!0),window.requestAnimationFrame(function(){tpGS.gsap.to(a.bgvid,.1,{zIndex:0,display:"none"})})):(i.stopVideo(a.bgvid,e,!0),!0!==a.poster&&(a.loadobj.bgColor=!0,a.bgcolor="#000"))),t},p=function(e,i,t,a){return Math.sqrt(Math.pow(e-t,2)+Math.pow(i-a,2))},g=function(e,i){var t=i+Math.PI/2;return{x1:e.x,y1:e.y,x2:e.x+100*Math.cos(t),y2:e.y+100*Math.sin(t)}},u=function(e,i){var t=e.y2-e.y1,a=e.x1-e.x2,o=t*e.x1+a*e.y1,r=i.y2-i.y1,s=i.x1-i.x2,n=r*i.x1+s*i.y1,d=t*s-r*a;return 0!==d&&{x:Math.round((s*o-a*n)/d*100)/100,y:Math.round((t*n-r*o)/d*100)/100}};window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.slideanims={loaded:!0,version:"6.5.10"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(jQuery),function(e){"use strict";jQuery.fn.revolution=jQuery.fn.revolution||{};var i=jQuery.fn.revolution;function t(e){return null==e?-1:i.isNumeric(e)?e:e.split(":").length>1?60*parseInt(e.split(":")[0],0)+parseInt(e.split(":")[1],0):e}jQuery.extend(!0,i,{preLoadAudio:function(e,t){i[t].videos=void 0===i[t].videos?{}:i[t].videos,e.find(".rs-layer-audio").each(function(){var a=jQuery(this),o=i[t].videos[a[0].id]=void 0===i[t].videos[a[0].id]?f(a.data(),"audio",i.gA(e[0],"key")):i[t].videos[a[0].id],r={};0===a.find("audio").length&&(r.src=null!=o.mp4?o.mp4:"",r.pre=o.pload||"",this.id=void 0===this.id||""===this.id?a.attr("audio-layer-"+Math.round(199999*Math.random())):this.id,r.id=this.id,void 0===i[t].audioqueue&&(i[t].audioqueue=[]),i[t].audioqueue.push(r),i.manageVideoLayer(a,t,i.gA(e[0],"key"),!0))})},preLoadAudioDone:function(e,t,a){var o=i[t].videos[e[0].id];i[t].audioqueue&&i[t].audioqueue.length>0&&jQuery.each(i[t].audioqueue,function(e,i){o.mp4!==i.src||i.pre!==a&&"auto"!==i.pre||(i.status="loaded")})},checkfullscreenEnabled:function(e){if(void 0!==window.fullScreen)return window.fullScreen;if(void 0!==document.fullscreen)return document.fullscreen;if(void 0!==document.mozFullScreen)return document.mozFullScreen;if(void 0!==document.webkitIsFullScreen)return document.webkitIsFullScreen;var t=i.isWebkit()&&/Apple Computer/.test(navigator.vendor)?42:5;return screen.width==i.winW&&Math.abs(screen.height-i.getWinH(e))0)&&(o.vimeoplayer.setCurrentTime(-1==o.ssec?0:o.ssec),o.vimeoplayer.pause()),0!=o.jsposter.length||o.bgvideo||"preset"===a||i.showVideo(e.find("iframe"));break;case"html5":if(i.ISM&&o.notonmobile)return!1;o.bgvideo||i.showVideo(o.jvideo),o.rwd&&"playing"!==o.cSS&&!isNaN(o.video.duration)&&(o.justReseted=!0,o.video.currentTime=-1==o.ssec?0:o.ssec),("mute"==o.volume||i.lastToggleState(e.videomutetoggledby)||!0===i[t].globalmute)&&(o.video.muted=!0)}}},Mute:function(e,t,a){var o=!1,r=i[t].videos[e[0].id];switch(r.type){case"youtube":r.player&&(!0===a&&r.player.mute(),!1===a&&n(r,parseInt(r.volcache,0)),o=r.player.isMuted());break;case"vimeo":r.volcachecheck||(r.volcache=r.volcache>1?r.volcache/100:r.volcache,r.volcachecheck=!0),r.volume=!0===a?"mute":!1===a?r.volcache:r.volume,void 0!==a&&null!=r.vimeoplayer&&s(r,!0===a?0:r.volcache),o="mute"==r.volume||0===r.volume;break;case"html5":r.volcachecheck||(r.volcache=r.volcache>1?r.volcache/100:r.volcache,r.volcachecheck=!0),r.video.volume=r.volcache,void 0!==a&&r.video&&(r.video.muted=a),o=void 0!==r.video?r.video.muted:o}if(void 0===a)return o},stopVideo:function(e,t,a){if(void 0!==i[t]&&void 0!==i[t]){var o=i[t].videos[e[0].id];if(void 0!==o&&("stopVideo"!==o.cRS||"paused"!==o.cSS))switch(o.cRS="stopVideo",i[t].leaveViewPortBasedStop||(i[t].lastplayedvideos=[]),i[t].leaveViewPortBasedStop=!1,o.type){case"youtube":void 0!==o.player&&2!==o.player.getPlayerState()&&5!==o.player.getPlayerState()&&(o.player.pauseVideo(),void 0!==a&&p(t,o,"hide"));break;case"vimeo":void 0!==o.vimeoplayer&&(o.vimeoplayer.pause(),void 0!==a&&p(t,o,"hide"));break;case"html5":o.video&&(o.video.pause(),i.ISM&&b(o,1))}}},playVideo:function(e,t,o){var r=i[t].videos[e[0].id];if(clearTimeout(r.videoplaywait),"playVideo"!==r.cRS||"playing"!==r.cSS)switch(r.cRS="playVideo",r.type){case"youtube":if(0==e.find("iframe").length)e.append(r.videomarkup),u(e,t,!0);else if(void 0!==r.player&&null!=r.player.playVideo){var s=r.player.getCurrentTime();r.nseTriggered&&(s=-1,r.nseTriggered=!1),-1!=r.ssec&&r.ssec>s&&r.player.seekTo(r.ssec),c(r)}else r.videoplaywait=setTimeout(function(){i.playVideo(e,t)},50);break;case"vimeo":if(0==e.find("iframe").length)delete r.vimeoplayer,e.append(r.videomarkup),u(e,t,!0);else if(e.hasClass("rs-apiready"))if(r.vimeoplayer=null==r.vimeoplayer?new Vimeo.Player(e.find("iframe").attr("id")):r.vimeoplayer,r.vimeoplayer.getPaused()){s=void 0===r.currenttime?0:r.currenttime;r.nseTriggered&&(s=-1,r.nseTriggered=!1),-1!=r.ssec&&r.ssec>s&&r.vimeoplayer.setCurrentTime(r.ssec),("mute"==r.volume||0===r.volume||i.lastToggleState(e.data("videomutetoggledby"))||!0===i[t].globalmute)&&(r.volumetoken=!0,r.vimeoplayer.setMuted(!0)),l(r)}else r.videoplaywait=setTimeout(function(){i.playVideo(e,t)},50);else r.videoplaywait=setTimeout(function(){i.playVideo(e,t)},50);break;case"html5":if(r.metaloaded){if((""+r.video.duration=="NaN"||r.video.readyState<4)&&!o)return r.loadRequested||(r.video.load(),r.loadRequested=!0),void setTimeout(function(){i.playVideo(e,t)},50);s=r.video.currentTime;r.nseTriggered&&(s=-1,r.nseTriggered=!1),-1!=r.ssec&&r.ssec>s&&r.ssec1?r.ratio.split(":")[0]/r.ratio.split(":")[1]:1;var s,n=t/a,d=r.vd*n*100,l=r.vd/n*100;"Edge"===i.get_browser()||"IE"===i.get_browser()?s=n>r.vd?{minWidth:"100%",height:d+"%",x:"-50%",y:"-50%",top:"50%",left:"50%",position:"absolute"}:{minHeight:"100%",width:l+"%",x:"-50%",y:"-50%",top:"50%",left:"50%",position:"absolute"}:(r.bgvideo&&void 0!==r.vimeoid&&"carousel"==i[e].sliderType&&(d=100,l=100),s=n>r.vd?{height:(r.fitCover?100:d)+"%",width:"100%",top:r.fitCover?0:-(d-100)/2+"%",left:"0px",position:"absolute"}:{width:(r.fitCover?100:l)+"%",height:"100%",left:r.fitCover?0:-(l-100)/2+"%",top:"0px",position:"absolute"}),void 0===r.vimeoid&&void 0===r.ytid||(s.maxWidth="none",s.maxHeight="none"),tpGS.gsap.set(r.jvideo,s)}}else i[e].resizePrepareCoverVideolistener=setTimeout(function(){i.prepareCoveredVideo(e)},100)},checkVideoApis:function(e,t){location.protocol;if(!i[t].youtubeapineeded){var a=e.find("iframe");if((null!=e.data("ytid")||a.length>0&&a.attr("src")&&a.attr("src").toLowerCase().indexOf("youtube")>0)&&(i[t].youtubeapineeded=!0),i[t].youtubeapineeded&&!window.rs_addedyt){i[t].youtubestarttime=Date.now(),window.rs_addedyt=!0;var o=document.createElement("script"),r=i.getByTag(document,"script")[0],s=!0;o.src="https://www.youtube.com/iframe_api",jQuery("head").find("*").each(function(){"https://www.youtube.com/iframe_api"==jQuery(this).attr("src")&&(s=!1)}),s&&r.parentNode.insertBefore(o,r)}}if(!i[t].vimeoapineeded){var n=e.find("iframe");if((null!=e.data("vimeoid")||n.length>0&&n.attr("src")&&n.attr("src").toLowerCase().indexOf("vimeo")>0)&&(i[t].vimeoapineeded=!0),i[t].vimeoapineeded&&!window.rs_addedvim){i[t].vimeostarttime=Date.now(),window.rs_addedvim=!0;var d=document.createElement("script");r=i.getByTag(document,"script")[0],s=!0;d.src="https://player.vimeo.com/api/player.js",jQuery("head").find("*").each(function(){"https://player.vimeo.com/api/player.js"==jQuery(this).attr("src")&&(s=!1)}),s&&r.parentNode.insertBefore(d,r)}}},manageVideoLayer:function(e,t,o,r){if(i[t].videos=void 0===i[t].videos?{}:i[t].videos,void 0===i[t].videos[e[0].id]||!0===r){var s=i[t].videos[e[0].id]=void 0===i[t].videos[e[0].id]?f(e.data(),void 0,o):i[t].videos[e[0].id];if(s.audio=void 0!==s.audio&&s.audio,i.ISM&&s.opom)0==e.find("rs-poster").length&&e.append('');else{s.jsposter=e.find("rs-poster"),s.id=e[0].id,s.pload="auto"===s.pload||"canplay"===s.pload||"canplaythrough"===s.pload||"progress"===s.pload?"auto":s.pload,s.type=null!=s.mp4||null!=s.webm?"html5":null!=s.ytid&&String(s.ytid).length>1?"youtube":null!=s.vimeoid&&String(s.vimeoid).length>1?"vimeo":"none",s.newtype="html5"==s.type&&0==e.find(s.audio?"audio":"video").length?"html5":"youtube"==s.type&&0==e.find("iframe").length?"youtube":"vimeo"==s.type&&0==e.find("iframe").length?"vimeo":"none",s.extras="",s.posterMarkup=void 0===s.posterMarkup?"":s.posterMarkup,!s.audio&&"1sttime"==s.aplay&&s.pausetimer&&s.bgvideo&&i.sA(e.closest("rs-slide")[0],"rspausetimeronce",1),s.audio||!s.bgvideo||!s.pausetimer||1!=s.aplay&&"true"!=s.aplay&&"no1sttime"!=s.aplay||i.sA(e.closest("rs-slide")[0],"rspausetimeralways",1),s.noInt&&e.find("*").addClass("rs-nointeraction"),!(null!=s.poster&&s.poster.length>2)||i.ISM&&s.npom||0==s.jsposter.length&&(s.posterMarkup+='');var n=!0;switch(s.cSS="created",s.cRS="created",s.newtype){case"html5":1==window.isSafari11&&(i[t].slideHasIframe=!0),s.audio&&e.addClass("rs-audio"),s.tag=s.audio?"audio":"video";var d="video"===s.tag&&(i.is_mobile()||i.isSafari11())?s.aplay||"true"===s.aplay?"muted playsinline autoplay":s.inline?" playsinline":"":"",l='
    ';l+="<"+s.tag+" "+d+" "+(s.controls&&"none"!==s.controls?" controls":"")+(s.bgvideo&&-1==d.indexOf("autoplay")?" autoplay":"")+(s.bgvideo&&-1==d.indexOf("muted")?" muted":"")+' style="'+("Edge"!==i.get_browser()?(s.fitCover?"object-fit:cover;background-size:cover;":"")+"opacity:0;width:100%; height:100%":"")+'" class="" '+(s.loop?"loop":"")+' preload="'+s.pload+'">',"video"===s.tag&&null!=s.webm&&"firefox"==i.get_browser().toLowerCase()&&(l=l+''),null!=s.mp4&&(l=l+'0?"audio/x-m4a":"audio/mpeg")+'" />'),null!=s.ogv&&(l=l+''),l+="
    ",l+=s.posterMarkup,s.controls&&!s.audio&&void 0===s.poster||s.bgvideo||(l+='
     
    '),s.videomarkup=l,n=!1,i.ISM&&s.notonmobile||i.isIE(8)||e.append(l),s.jvideo=e.find(s.tag),s.video=s.jvideo[0],s.html5vid=s.jvideo.parent(),a(s.video,"canplay",function(e){m(e,t),i.resetVideo(e,t)}(e));break;case"youtube":i[t].slideHasIframe=!0,s.controls&&"none"!==s.controls||(s.vatr=s.vatr.replace("controls=1","controls=0"),-1==s.vatr.toLowerCase().indexOf("controls")&&(s.vatr=s.vatr+"&controls=0")),(s.inline||"RS-BGVIDEO"===e[0].tagName)&&(s.vatr=s.vatr+"&playsinline=1"),-1!=s.ssec&&(s.vatr+="&start="+s.ssec),-1!=s.esec&&(s.vatr+="&end="+s.esec);var c=s.vatr.split("origin=https://");s.vatrnew=c.length>1?c[0]+"origin=https://"+(self.location.href.match(/www/gi)&&!c[1].match(/www/gi)?"www."+c[1]:c[1]):s.vatr,s.videomarkup='';break;case"vimeo":i[t].slideHasIframe=!0,s.controls&&"none"!==s.controls?(s.vatr=s.vatr.replace("background=0","background=1"),-1==s.vatr.toLowerCase().indexOf("background")&&(s.vatr=s.vatr+"&background=1")):(s.vatr=s.vatr.replace("background=1","background=0"),-1==s.vatr.toLowerCase().indexOf("background")&&(s.vatr=s.vatr+"&background=0")),s.vatr="autoplay="+(!0===s.aplay?1:0)+"&"+s.vatr,s.bgvideo&&(s.prePlayForaWhile=!0),i.ISM&&!0===s.aplay&&(s.vatr="muted=1&"+s.vatr),s.loop&&(s.vatr="loop=1&"+s.vatr),s.videomarkup=''}if(!(null!=s.poster&&s.poster.length>2)||i.ISM&&s.npom){if(i.ISM&&s.notonmobile)return!1;0!=e.find("iframe").length||"youtube"!=s.type&&"vimeo"!=s.type||(delete s.vimeoplayer,e.append(s.videomarkup),u(e,t,!("vimeo"!==s.newtype||!s.bgvideo),!0))}else n&&0==e.find("rs-poster").length&&e.append(s.posterMarkup),0==e.find("iframe").length&&(s.jsposter=e.find("rs-poster"),s.jsposter.on("click",function(){if(i.playVideo(e,t,!0),i.ISM){if(s.notonmobile)return!1;tpGS.gsap.to(s.jsposter,.3,{opacity:0,visibility:"hidden",force3D:"auto",ease:"power3.inOut"}),i.showVideo(e.find("iframe"))}}));if("none"!==s.doverlay&&void 0!==s.doverlay){var p=i.createOverlay(t,s.doverlay,s.doverlaysize,{0:s.doverlaycolora,1:s.doverlaycolorb});s.bgvideo&&1!=e.closest("rs-sbg-wrap").find("rs-dotted").length?e.closest("rs-sbg-wrap").append(''):s.bgvideo||1==e.find("rs-dotted").length||e.append('')}s.bgvideo&&("youtube"!==s.type&&"vimeo"!==s.type&&(e[0].style.display="none"),e[0].style.zIndex=0,tpGS.gsap.set(e.find("video, iframe"),{opacity:0}))}}}});var a=function(e,i,t){e.addEventListener?e.addEventListener(i,t,{capture:!1,passive:!0}):e.attachEvent(i,t,{capture:!1,passive:!0})},o=function(e,i,t){var a={};return a.video=e,a.type=i,a.settings=t,a},r=function(e,t){var a=i[e].videos[t[0].id];(a.bgvideo||t.hasClass("rs-fsv"))&&((void 0===a.ratio||a.ratio.split(":").length<=1)&&(a.ratio="16:9"),requestAnimationFrame(function(){i.prepareCoveredVideo(e)}))},s=function(e,t){var a=e.vimeoplayer;a.getPaused().then(function(o){e.volumetoken=!0;var r=!o,s=a.setVolume(t);void 0!==s&&s.then(function(i){a.getPaused().then(function(i){r===i&&(e.volume="mute",a.getMuted().then(function(i){i||(e.volumetoken=!0,a.setMuted(!0))}),a.play())}).catch(function(e){console.log("Get Paused Function Failed for Vimeo Volume Changes Inside the Promise")})}).catch(function(t){r&&(e.volume="mute",e.volumetoken=!0,a.setMuted(!0),a.play()),i.ISM&&b(e,0)})}).catch(function(){console.log("Get Paused Function Failed for Vimeo Volume Changes")})},n=function(e,i){var t=e.player.getPlayerState();"mute"===i?e.player.mute():(e.player.unMute(),e.player.setVolume(i)),setTimeout(function(){1===t&&1!==e.player.getPlayerState()&&(e.player.mute(),e.player.playVideo())},39)},d=function(e,t,a){if("playVideo"===e.cRS){var o=e.video.play();void 0!==o&&o.then(function(t){!0===e.twaudio&&!0!==i[a].globalmute&&(e.twaudio=!1,i.clickedOnce&&(e.video.volume=e.volcache,e.volume=e.volcache,e.video.muted=!1))}).catch(function(i){e.video.pause(),!0!==t&&d(e,!0,a)}),i.ISM&&b(e,0)}},l=function(e){if("playVideo"===e.cRS){var i=e.vimeoplayer.play();void 0!==i&&i.then(function(e){}).catch(function(i){e.vimeoplayer.volumetoken=!0,e.vimeoplayer.setMuted(!0),e.vimeoplayer.play()})}},c=function(e){"playVideo"===e.cRS&&e.player.playVideo()},p=function(e,t,a,o){clearTimeout(t.repeatedPosterCalls),t.repeatedPosterCalls=setTimeout(function(){"show"===a||"playing"===t.cSS&&!0!==t.VideoIsVisible?(void 0!==t.showhideposter&&t.showhideposter.pause(),t.showhideposter=tpGS.gsap.timeline(),t.jsposter.length>0&&t.showhideposter.add(tpGS.gsap.to(t.jsposter,.3,{zIndex:5,autoAlpha:0,force3D:"auto",ease:"power3.inOut"}),0),t.jvideo.length>0&&t.showhideposter.add(tpGS.gsap.to(t.jvideo,void 0!==o?o:.001,{opacity:1,display:"block",ease:t.jsposter.length>0?"power3.inOut":"power3.out"}),0),t.VideoIsVisible=!0):("hide"===a||"paused"===t.cSS&&1!=i.checkfullscreenEnabled(e)&&t.jsposter.length>0&&!1!==t.VideoIsVisible&&!0!==t.seeking)&&(void 0!==t.showhideposter&&t.showhideposter.pause(),t.showhideposter=tpGS.gsap.timeline(),t.jsposter.length>0&&t.showhideposter.add(tpGS.gsap.to(t.jsposter,.3,{zIndex:5,autoAlpha:1,force3D:"auto",ease:"power3.inOut"}),0),t.jvideo.length>0&&t.showhideposter.add(tpGS.gsap.to(t.jvideo,void 0!==o?o:.001,{opacity:0,ease:t.jsposter.length>0?"power3.inOut":"power3.out"}),.3),t.bgvideo&&void 0!==t.nBG&&void 0!==t.nBG.loadobj&&(t.nBG.video=t.nBG.loadobj.img),t.VideoIsVisible=!1)},void 0!==a?0:100)},g=function(e,t,a){e.cSS="playing",e.vimeostarted=!0,e.nextslidecalled=!1,e.jsposter=void 0===e.jsposter||0===e.jsposter.length?t.find("rs-poster"):e.jsposter,e.jvideo=t.find("iframe"),i[a].c.trigger("revolution.slide.onvideoplay",o(e.vimeoplayer,"vimeo",e)),i[a].stopByVideo=e.pausetimer,w(t,a),"mute"==e.volume||0===e.volume||i.lastToggleState(t.data("videomutetoggledby"))||!0===i[a].globalmute?(e.volumetoken=!0,e.vimeoplayer.setMuted(!0)):s(e,parseInt(e.volcache,0)/100||.75),i.toggleState(e.videotoggledby)},u=function(e,t,a,s){var d=i[t].videos[e[0].id],l="iframe"+Math.round(1e5*Math.random()+1);if(d.jvideo=e.find("iframe"),r(t,e),d.jvideo.attr("id",l),d.startvideonow=a,d.videolistenerexist){if(a)switch(d.type){case"youtube":i.playVideo(e,t),-1!=d.ssec&&d.player.seekTo(d.ssec);break;case"vimeo":i.playVideo(e,t),-1!=d.ssec&&d.vimeoplayer.seekTo(d.ssec)}}else switch(d.type){case"youtube":if("undefined"==typeof YT||void 0===YT.Player)return i.checkVideoApis(e,t),void setTimeout(function(){u(e,t,a,s)},50);d.player=new YT.Player(l,{events:{onStateChange:function(a){a.data==YT.PlayerState.PLAYING?(d.cSS="playing",i[t].onceVideoPlayed=!0,!1===d.player.isMuted()&&(d.volume=d.volcache=d.player.getVolume()),"mute"==d.volume||0===d.volume||i.lastToggleState(e.data("videomutetoggledby"))||!0===i[t].globalmute?d.player.mute():n(d,parseInt(d.volcache,0)||75),i[t].stopByVideo=!0,w(e,t),d.pausetimer?i[t].c.trigger("stoptimer"):i[t].stopByVideo=!1,i[t].c.trigger("revolution.slide.onvideoplay",o(d.player,"youtube",d)),i.toggleState(d.videotoggledby)):(d.cSS="paused",0==a.data&&d.loop&&(-1!=d.ssec&&d.player.seekTo(d.ssec),i.playVideo(e,t),i.toggleState(d.videotoggledby)),-1!=a.data&&3!=a.data&&(i[t].stopByVideo=!1,i[t].tonpause=!1,y(e,t),i[t].c.trigger("starttimer"),i[t].c.trigger("revolution.slide.onvideostop",o(d.player,"youtube",d)),null!=i[t].videoIsPlaying&&i[t].videoIsPlaying.attr("id")!=e.attr("id")||i.unToggleState(d.videotoggledby)),0==a.data&&d.nse?(h(),d.nseTriggered=!0,i[t].c.revnext(),y(e,t)):(y(e,t),i[t].stopByVideo=!1,3!==a.data&&(-1!=d.lasteventdata&&3!=d.lasteventdata&&void 0!==d.lasteventdata||-1!=a.data&&3!=a.data)&&i[t].c.trigger("starttimer"),i[t].c.trigger("revolution.slide.onvideostop",o(d.player,"youtube",d)),null!=i[t].videoIsPlaying&&i[t].videoIsPlaying.attr("id")!=e.attr("id")||i.unToggleState(d.videotoggledby))),clearTimeout(d.postOrVideoTimer),3!==a.data&&(d.postOrVideoTimer=setTimeout(function(){p(t,d)},1===d.lasteventdata&&2===a.data||2===d.lasteventdata&&3!==a.data?1e3:0),d.lasteventdata=a.data)},onReady:function(a){var o,r=i.is_mobile(),n=e.hasClass("rs-layer-video");d.ready=!0,!r&&(!i.isSafari11()||r&&n)||"RS-BGVIDEO"!==e[0].tagName&&(!n||!0!==d.aplay&&"true"!==d.aplay)||(o=!0,d.player.setVolume(0),d.volume="mute",d.player.mute(),clearTimeout(e.data("mobilevideotimr")),2!==d.player.getPlayerState()&&-1!==d.player.getPlayerState()||e.data("mobilevideotimr",setTimeout(function(){i.playVideo(e,t)},500))),o||"mute"!=d.volume||(d.player.setVolume(0),d.player.mute()),e.addClass("rs-apiready"),null==d.speed&&1===d.speed||a.target.setPlaybackRate(parseFloat(d.speed)),d.jsposter.off("click"),d.jsposter.on("click",function(){i.playVideo(e,t,!0)}),d.startvideonow?(i.playVideo(e,t),-1!=d.ssec&&d.player.seekTo(d.ssec)):s&&p(t,d,"show",.2),d.videolistenerexist=!0}}});break;case"vimeo":if("undefined"==typeof Vimeo||void 0===Vimeo.Player)return i.checkVideoApis(e,t),void setTimeout(function(){u(e,t,a,s)},50);for(var c,m=d.jvideo.attr("src"),v={},f=m,b=/([^&=]+)=([^&]*)/g;c=b.exec(f);)v[decodeURIComponent(c[1])]=decodeURIComponent(c[2]);m=(m=null!=v.player_id?m.replace(v.player_id,l):m+"&player_id="+l).replace(/&api=0|&api=1/g,"");var _,S=i.is_mobile()||i.isSafari11(),x="RS-BGVIDEO"===e[0].tagName;if(S&&x&&(m+="&background=1"),d.jvideo.attr("src",m),d.vimeoplayer=void 0===d.vimeoplayer||!1===d.vimeoplayer?new Vimeo.Player(l):d.vimeoplayer,S)x?_=!0:(d.aplay||"true"===d.aplay)&&(_=!0),_&&(d.volumetoken=!0,d.vimeoplayer.setMuted(!0),d.volume="mute");d.vimeoplayer.on("play",function(a){i[t].onceVideoPlayed=!0,d.cSS="playing",d.vimeostarted||g(d,e,t)}),d.vimeoplayer.on("loaded",function(a){var o={};d.vimeoplayer.getVideoWidth().then(function(i){o.width=i,void 0!==o.width&&void 0!==o.height&&(d.ratio=o.width+":"+o.height,d.vimeoplayerloaded=!0,r(t,e))}),d.vimeoplayer.getVideoHeight().then(function(i){o.height=i,void 0!==o.width&&void 0!==o.height&&(d.ratio=o.width+":"+o.height,d.vimeoplayerloaded=!0,r(t,e))}),d.startvideonow?("mute"===d.volume&&(d.volumetoken=!0,d.vimeoplayer.setMuted(!0)),i.playVideo(e,t),-1!=d.ssec&&d.vimeoplayer.setCurrentTime(d.ssec)):s&&p(t,d,"show",.2)}),e.addClass("rs-apiready"),d.vimeoplayer.on("volumechange",function(e){d.volumetoken&&(d.volume=e.volume),d.volumetoken=!1}),d.vimeoplayer.on("timeupdate",function(a){p(t,d),d.vimeostarted||0===a.percent||void 0!==i[t].activeRSSlide&&d.slideid!==i.gA(i[t].slides[i[t].activeRSSlide],"key")||g(d,e,t),d.pausetimer&&"playing"==i[t].sliderstatus&&(i[t].stopByVideo=!0,i[t].c.trigger("stoptimer")),d.currenttime=a.seconds,0!=d.esec&&-1!==d.esec&&d.esec 
    ');var n="video, rs-poster, .tp-video-play-button";void 0!==s.poster&&s.controls&&(n=".tp-video-play-button"),e.find(n).on("click",function(){!1===s.loop&&s.esec>0&&s.esec<=s.video.currentTime||(e.hasClass("videoisplaying")?i.stopVideo(e,t):i.playVideo(e,t,!0))})}(e.hasClass("rs-fsv")||s.bgvideo)&&(s.bgvideo||e.hasClass("rs-fsv")?(s.html5vid.addClass("fullcoveredvideo"),void 0!==s.ratio&&1!=s.ratio.split(":").length||(s.ratio="16:9"),i.prepareCoveredVideo(t)):s.html5vid.addClass("rs-fsv")),a(s.video,"canplaythrough",function(){i.preLoadAudioDone(e,t,"canplaythrough")}),a(s.video,"canplay",function(){i.preLoadAudioDone(e,t,"canplay")}),a(s.video,"progress",function(){i.preLoadAudioDone(e,t,"progress")}),a(s.video,"pause",function(){i.ISM&&b(s,1)}),a(s.video,"timeupdate",function(e){this.BGrendered=!0,p(t,s),-1===s.esec&&s.loop&&1==window.isSafari11&&(s.esec=s.video.duration-.075),void 0!==s.lastCurrentTime?s.fps=s.video.currentTime-s.lastCurrentTime:s.fps=.1,s.lastCurrentTime=s.video.currentTime,0!=s.esec&&-1!=s.esec&&s.esec1?s.volcache/100:s.volcache,"mute"==s.volume?s.video.muted=!0:null!=s.volcache&&(s.video.volume=s.volcache)),e.addClass("videoisplaying"),w(e,t),clearTimeout(s.showCoverSoon),!0!==s.pausetimer||"audio"==s.tag?(i[t].stopByVideo=!1,i[t].c.trigger("revolution.slide.onvideostop",o(s.video,"html5",s))):(i[t].stopByVideo=!0,i[t].c.trigger("revolution.slide.onvideoplay",o(s.video,"html5",s))),s.pausetimer&&"playing"==i[t].sliderstatus&&(i[t].stopByVideo=!0,i[t].c.trigger("stoptimer")),i.toggleState(s.videotoggledby)}),a(s.video,"seeked",function(){s.seeking=!1}),a(s.video,"seeking",function(){s.seeking=!0}),a(s.video,"pause",function(a){s.cSS="paused",p(t,s),e.removeClass("videoisplaying"),s.bgvideo&&(s.nBG.drawVideoCanvasImagesRecall=!1,s.nBG.videoisplaying=!1),i[t].stopByVideo=!1,y(e,t),"audio"!=s.tag&&i[t].c.trigger("starttimer"),i[t].c.trigger("revolution.slide.onvideostop",o(s.video,"html5",s)),null!=i[t].videoIsPlaying&&i[t].videoIsPlaying.attr("id")!=e.attr("id")||i.unToggleState(s.videotoggledby)}),a(s.video,"ended",function(){s.cSS="paused",h(),p(t,s),y(e,t),i[t].stopByVideo=!1,y(e,t),"audio"!=s.tag&&i[t].c.trigger("starttimer"),i[t].c.trigger("revolution.slide.onvideostop",o(s.video,"html5",e.data())),s.nse&&s.video.currentTime>0&&(1==!i[t].jcnah&&(s.nseTriggered=!0,i[t].c.revnext(),i[t].jcnah=!0),setTimeout(function(){i[t].jcnah=!1},1500)),e.removeClass("videoisplaying"),s.bgvideo&&(s.nBG.drawVideoCanvasImagesRecall=!1,s.nBG.videoisplaying=!1),!0!==i[t].inviewport&&void 0!==i[t].inviewport||(i[t].lastplayedvideos=[])}),a(s.video,"volumechange",function(){s.video.muted?s.volume="mute":s.volume=s.volcache=s.video.volume})},v=function(e){return"t"===e||!0===e||"true"===e||"f"!==e&&!1!==e&&"false"!==e&&e},f=function(e,i,a){e.audio="audio"===i;var o=void 0===e.video?[]:e.video.split(";"),r={volume:e.audio?1:"mute",pload:"auto",ratio:"16:9",loop:!0,aplay:"true",fitCover:!0,afs:!0,controls:!1,nse:!0,npom:!1,opom:!1,inline:!0,notonmobile:!1,start:-1,end:-1,doverlay:"none",doverlaysize:1,doverlaycolora:"transparent",doverlaycolorb:"#000000",scop:!1,rwd:!0,speed:1,ploadwait:5,stopAV:1!==e.bgvideo,noInt:!1,volcache:75};for(var s in o)if(o.hasOwnProperty(s)){var n=o[s].split(":");switch(n[0]){case"v":r.volume=n[1];break;case"twa":r.twaudio=n[1];break;case"vd":r.volcache=n[1];break;case"p":r.pload=n[1];break;case"ar":r.ratio=n[1]+(void 0!==n[2]?":"+n[2]:"");break;case"ap":r.aplay=v(n[1]);break;case"vfc":r.fitCover=v(n[1]);break;case"afs":r.afs=v(n[1]);break;case"vc":r.controls=n[1];break;case"nse":r.nse=v(n[1]);break;case"npom":r.npom=v(n[1]);break;case"opom":r.opom=v(n[1]);break;case"t":r.vtype=n[1];break;case"inl":r.inline=v(n[1]);break;case"nomo":r.notonmobile=v(n[1]);break;case"sta":r.start=n[1]+(void 0!==n[2]?":"+n[2]:"");break;case"end":r.end=n[1]+(void 0!==n[2]?":"+n[2]:"");break;case"do":r.doverlay=n[1];break;case"dos":r.doverlaysize=n[1];break;case"doca":r.doverlaycolora=n[1];break;case"docb":r.doverlaycolorb=n[1];break;case"scop":r.scop=v(n[1]);break;case"rwd":r.rwd=v(n[1]);break;case"sp":r.speed=n[1];break;case"vw":r.ploadwait=parseInt(n[1],0)||5;break;case"sav":r.stopAV=v(n[1]);break;case"noint":r.noInt=v(n[1]);break;case"l":r.loopcache=n[1],r.loop="loop"===n[1]||"loopandnoslidestop"===n[1]||"none"!==n[1]&&v(n[1]);break;case"ptimer":r.pausetimer=v(n[1]);break;case"sat":r.waitToSlideTrans=v(n[1])}}return null==e.mp4&&null==e.webm&&(r.fitCover=!1),void 0!==e.bgvideo&&(r.bgvideo=e.bgvideo),r.noInt&&(r.controls=!1),void 0!==e.mp4&&(r.mp4=e.mp4),void 0!==e.videomp4&&(r.mp4=e.videomp4),void 0!==e.ytid&&(r.ytid=e.ytid),void 0!==e.ogv&&(r.ogv=e.ogv),void 0!==e.webm&&(r.webm=e.webm),void 0!==e.vimeoid&&(r.vimeoid=e.vimeoid),void 0!==e.vatr&&(r.vatr=e.vatr),void 0!==e.videoattributes&&(r.vatr=e.videoattributes),void 0!==e.poster&&(r.poster=e.poster),r.slideid=a,r.aplay="true"===r.aplay||r.aplay,1===r.bgvideo&&(r.volume="mute"),r.ssec=t(r.start),r.esec=t(r.end),r.pausetimer=void 0===r.pausetimer?"loopandnoslidestop"!==r.loopcache:r.pausetimer,r.inColumn=e._incolumn,r.audio=e.audio,!0!==r.loop&&"true"!==r.loop||!0!==r.nse&&"true"!==r.nse||(r.loop=!1),r.aplay&&r.twaudio&&!r.bgvideo&&(r.twaudio=!0),r},w=function(e,t){if(i[t].playingvideos=void 0===i[t].playingvideos?new Array:i[t].playingvideos,i[t].videos[e[0].id].stopAV&&void 0!==i[t].playingvideos&&i[t].playingvideos.length>0)for(var a in i[t].lastplayedvideos=jQuery.extend(!0,[],i[t].playingvideos),i[t].playingvideos)i[t].playingvideos.hasOwnProperty(a)&&i.stopVideo(i[t].playingvideos[a],t);i[t].playingvideos.push(e),i[t].videoIsPlaying=e},y=function(e,t){void 0!==i[t]&&void 0!==i[t]&&null!=i[t].playingvideos&&jQuery.inArray(e,i[t].playingvideos)>=0&&i[t].playingvideos.splice(jQuery.inArray(e,i[t].playingvideos),1)},b=function(e,t){if(void 0!==e&&(void 0===t&&(t=0),i.ISM&&!e.bgvideo)){e.playPauseBtnTween&&e.playPauseBtnTween.kill&&e.playPauseBtnTween.kill();var a=i.closestNode(e.video,"RS-LAYER"),o=e.controls?1:0,r=e.controls?0:.3;e.controls&&e.poster&&0===t&&(r=0,o=0),a&&(e.playPauseBtnTween=tpGS.gsap.to(a.querySelector(".tp-video-play-button"),{duration:r,delay:o,opacity:t}))}};window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.video={loaded:!0,version:"6.5.25"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(jQuery); if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
      ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
    • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
        '),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('
      • ×
      • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change"); if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null; },e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `
        ', filterClearBtn: '', li: '
      • ', divider: '
      • ', liGroup: '
      • ' }}, constructor: Multiselect, buildContainer: function(){ this.$container=$(this.options.buttonContainer); this.$container.on('show.bs.dropdown', this.options.onDropdownShow); this.$container.on('hide.bs.dropdown', this.options.onDropdownHide); this.$container.on('shown.bs.dropdown', this.options.onDropdownShown); this.$container.on('hidden.bs.dropdown', this.options.onDropdownHidden); }, buildButton: function(){ this.$button=$(this.options.templates.button).addClass(this.options.buttonClass); if(this.$select.attr('class')&&this.options.inheritClass){ this.$button.addClass(this.$select.attr('class')); } if(this.$select.prop('disabled')){ this.disable(); }else{ this.enable(); } if(this.options.buttonWidth&&this.options.buttonWidth!=='auto'){ this.$button.css({ 'width':'100%', //this.options.buttonWidth, 'overflow':'hidden', 'text-overflow':'ellipsis' }); this.$container.css({ 'width': this.options.buttonWidth }); } var tabindex=this.$select.attr('tabindex'); if(tabindex){ this.$button.attr('tabindex', tabindex); } this.$container.prepend(this.$button); }, buildDropdown: function(){ this.$ul=$(this.options.templates.ul); if(this.options.dropRight){ this.$ul.addClass('pull-right'); } if(this.options.maxHeight){ this.$ul.css({ 'max-height': this.options.maxHeight + 'px', 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } if(this.options.dropUp){ var height=Math.min(this.options.maxHeight, $('option[data-role!="divider"]', this.$select).length*26 + $('option[data-role="divider"]', this.$select).length*19 + (this.options.includeSelectAllOption ? 26:0) + (this.options.enableFiltering||this.options.enableCaseInsensitiveFiltering ? 44:0)); var moveCalc=height + 34; this.$ul.css({ 'max-height': height + 'px', 'overflow-y': 'auto', 'overflow-x': 'hidden', 'margin-top': "-" + moveCalc + 'px' }); } this.$container.append(this.$ul); }, buildDropdownOptions: function(){ this.$select.children().each($.proxy(function(index, element){ var $element=$(element); var tag=$element.prop('tagName') .toLowerCase(); if($element.prop('value')===this.options.selectAllValue){ return; } if(tag==='optgroup'){ this.createOptgroup(element); } else if(tag==='option'){ if($element.data('role')==='divider'){ this.createDivider(); }else{ this.createOptionValue(element); }} }, this)); $('li:not(.multiselect-group) input', this.$ul).on('change', $.proxy(function(event){ var $target=$(event.target); var checked=$target.prop('checked')||false; var isSelectAllOption=$target.val()===this.options.selectAllValue; if(this.options.selectedClass){ if(checked){ $target.closest('li') .addClass(this.options.selectedClass); }else{ $target.closest('li') .removeClass(this.options.selectedClass); }} var value=$target.val(); var $option=this.getOptionByValue(value); var $optionsNotThis=$('option', this.$select).not($option); var $checkboxesNotThis=$('input', this.$container).not($target); if(isSelectAllOption){ if(checked){ this.selectAll(this.options.selectAllJustVisible, true); }else{ this.deselectAll(this.options.selectAllJustVisible, true); }}else{ if(checked){ $option.prop('selected', true); if(this.options.multiple){ $option.prop('selected', true); }else{ if(this.options.selectedClass){ $($checkboxesNotThis).closest('li').removeClass(this.options.selectedClass); } $($checkboxesNotThis).prop('checked', false); $optionsNotThis.prop('selected', false); this.$button.click(); } if(this.options.selectedClass==="active"){ $optionsNotThis.closest("a").css("outline", ""); }}else{ $option.prop('selected', false); } this.options.onChange($option, checked); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }} this.$select.change(); this.updateButtonText(); if(this.options.preventInputChangeEvent){ return false; }}, this)); $('li a', this.$ul).on('mousedown', function(e){ if(e.shiftKey){ return false; }}); $('li a', this.$ul).on('touchstart click', $.proxy(function(event){ event.stopPropagation(); var $target=$(event.target); if(event.shiftKey&&this.options.multiple){ if($target.is("label")){ event.preventDefault(); $target=$target.find("input"); $target.prop("checked", !$target.prop("checked")); } var checked=$target.prop('checked')||false; if(this.lastToggledInput!==null&&this.lastToggledInput!==$target){ var from=$target.closest("li").index(); var to=this.lastToggledInput.closest("li").index(); if(from > to){ var tmp=to; to=from; from=tmp; } ++to; var range=this.$ul.find("li").slice(from, to).find("input"); range.prop('checked', checked); if(this.options.selectedClass){ range.closest('li') .toggleClass(this.options.selectedClass, checked); } for (var i=0, j=range.length; i < j; i++){ var $checkbox=$(range[i]); var $option=this.getOptionByValue($checkbox.val()); $option.prop('selected', checked); }} $target.trigger("change"); } if($target.is("input")&&!$target.closest("li").is(".multiselect-item")){ this.lastToggledInput=$target; } $target.blur(); }, this)); this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function(event){ if($('input[type="text"]', this.$container).is(':focus')){ return; } if(event.keyCode===9&&this.$container.hasClass('open')){ this.$button.click(); }else{ var $items=$(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible"); if(!$items.length){ return; } var index=$items.index($items.filter(':focus')); if(event.keyCode===38&&index > 0){ index--; } else if(event.keyCode===40&&index < $items.length - 1){ index++; } else if(!~index){ index=0; } var $current=$items.eq(index); $current.focus(); if(event.keyCode===32||event.keyCode===13){ var $checkbox=$current.find('input'); $checkbox.prop("checked", !$checkbox.prop("checked")); $checkbox.change(); } event.stopPropagation(); event.preventDefault(); }}, this)); if(this.options.enableClickableOptGroups&&this.options.multiple){ $("li.multiselect-group input", this.$ul).on("change", $.proxy(function(event){ event.stopPropagation(); var $target=$(event.target); var checked=$target.prop('checked')||false; var $li=$(event.target).closest('li'); var $group=$li.nextUntil("li.multiselect-group") .not('.multiselect-filter-hidden') .not('.disabled'); var $inputs=$group.find("input"); var values=[]; var $options=[]; if(this.options.selectedClass){ if(checked){ $li.addClass(this.options.selectedClass); }else{ $li.removeClass(this.options.selectedClass); }} $.each($inputs, $.proxy(function(index, input){ var value=$(input).val(); var $option=this.getOptionByValue(value); if(checked){ $(input).prop('checked', true); $(input).closest('li') .addClass(this.options.selectedClass); $option.prop('selected', true); }else{ $(input).prop('checked', false); $(input).closest('li') .removeClass(this.options.selectedClass); $option.prop('selected', false); } $options.push(this.getOptionByValue(value)); }, this)) this.options.onChange($options, checked); this.updateButtonText(); this.updateSelectAll(); }, this)); } if(this.options.enableCollapsibleOptGroups&&this.options.multiple){ $("li.multiselect-group .caret-container", this.$ul).on("click", $.proxy(function(event){ var $li=$(event.target).closest('li'); var $inputs=$li.nextUntil("li.multiselect-group") .not('.multiselect-filter-hidden'); var visible=true; $inputs.each(function(){ visible=visible&&$(this).is(':visible'); }); if(visible){ $inputs.hide() .addClass('multiselect-collapsible-hidden'); }else{ $inputs.show() .removeClass('multiselect-collapsible-hidden'); }}, this)); $("li.multiselect-all", this.$ul).css('background', '#f3f3f3').css('border-bottom', '1px solid #eaeaea'); $("li.multiselect-all > a > label.checkbox", this.$ul).css('padding', '3px 20px 3px 35px'); $("li.multiselect-group > a > input", this.$ul).css('margin', '4px 0px 5px -20px'); }}, createOptionValue: function(element){ var $element=$(element); if($element.is(':selected')){ $element.prop('selected', true); } var label=this.options.optionLabel(element); var classes=this.options.optionClass(element); var value=$element.val(); var inputType=this.options.multiple ? "checkbox":"radio"; var $li=$(this.options.templates.li); var $label=$('label', $li); $label.addClass(inputType); $li.addClass(classes); if(this.options.enableHTML){ $label.html(" " + label); }else{ $label.text(" " + label); } var $checkbox=$('').attr('type', inputType); var name=this.options.checkboxName($element); if(name){ $checkbox.attr('name', name); } $label.prepend($checkbox); var selected=$element.prop('selected')||false; $checkbox.val(value); if(value===this.options.selectAllValue){ $li.addClass("multiselect-item multiselect-all"); $checkbox.parent().parent() .addClass('multiselect-all'); } $label.attr('title', $element.attr('title')); this.$ul.append($li); if($element.is(':disabled')){ $checkbox.attr('disabled', 'disabled') .prop('disabled', true) .closest('a') .attr("tabindex", "-1") .closest('li') .addClass('disabled'); } $checkbox.prop('checked', selected); if(selected&&this.options.selectedClass){ $checkbox.closest('li') .addClass(this.options.selectedClass); }}, createDivider: function(element){ var $divider=$(this.options.templates.divider); this.$ul.append($divider); }, createOptgroup: function(group){ var label=$(group).attr("label"); var value=$(group).attr("value"); var $li=$('
      • '); var classes=this.options.optionClass(group); $li.addClass(classes); if(this.options.enableHTML){ $('label b', $li).html(" " + label); }else{ $('label b', $li).text(" " + label); } if(this.options.enableCollapsibleOptGroups&&this.options.multiple){ $('a', $li).append(''); } if(this.options.enableClickableOptGroups&&this.options.multiple){ $('a label', $li).prepend(''); } if($(group).is(':disabled')){ $li.addClass('disabled'); } this.$ul.append($li); $("option", group).each($.proxy(function($, group){ this.createOptionValue(group); }, this)) }, buildSelectAll: function(){ if(typeof this.options.selectAllValue==='number'){ this.options.selectAllValue=this.options.selectAllValue.toString(); } var alreadyHasSelectAll=this.hasSelectAll(); if(!alreadyHasSelectAll&&this.options.includeSelectAllOption&&this.options.multiple && $('option', this.$select).length > this.options.includeSelectAllIfMoreThan){ if(this.options.includeSelectAllDivider){ this.$ul.prepend($(this.options.templates.divider)); } var $li=$(this.options.templates.li); $('label', $li).addClass("checkbox"); if(this.options.enableHTML){ $('label', $li).html(" " + this.options.selectAllText); }else{ $('label', $li).text(" " + this.options.selectAllText); } if(this.options.selectAllName){ $('label', $li).prepend(''); }else{ $('label', $li).prepend(''); } var $checkbox=$('input', $li); $checkbox.val(this.options.selectAllValue); $li.addClass("multiselect-item multiselect-all"); $checkbox.parent().parent() .addClass('multiselect-all'); this.$ul.prepend($li); $checkbox.prop('checked', false); }}, buildFilter: function(){ if(this.options.enableFiltering||this.options.enableCaseInsensitiveFiltering){ var enableFilterLength=Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering); if(this.$select.find('option').length >=enableFilterLength){ this.$filter=$(this.options.templates.filter); $('input', this.$filter).attr('placeholder', this.options.filterPlaceholder); if(this.options.includeFilterClearBtn){ var clearBtn=$(this.options.templates.filterClearBtn); clearBtn.on('click', $.proxy(function(event){ clearTimeout(this.searchTimeout); this.$filter.find('.multiselect-search').val(''); $('li', this.$ul).show().removeClass('multiselect-filter-hidden'); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }}, this)); this.$filter.find('.input-group').append(clearBtn); } this.$ul.prepend(this.$filter); this.$filter.val(this.query).on('click', function(event){ event.stopPropagation(); }).on('input keydown', $.proxy(function(event){ if(event.which===13){ event.preventDefault(); } clearTimeout(this.searchTimeout); this.searchTimeout=this.asyncFunction($.proxy(function(){ if(this.query!==event.target.value){ this.query=event.target.value; var currentGroup, currentGroupVisible; $.each($('li', this.$ul), $.proxy(function(index, element){ var value=$('input', element).length > 0 ? $('input', element).val():""; var text=$('label', element).text(); var filterCandidate=''; if((this.options.filterBehavior==='text')){ filterCandidate=text; } else if((this.options.filterBehavior==='value')){ filterCandidate=value; } else if(this.options.filterBehavior==='both'){ filterCandidate=text + '\n' + value; } if(value!==this.options.selectAllValue&&text){ var showElement=false; if(this.options.enableCaseInsensitiveFiltering){ filterCandidate=filterCandidate.toLowerCase(); this.query=this.query.toLowerCase(); } if(this.options.enableFullValueFiltering&&this.options.filterBehavior!=='both'){ var valueToMatch=filterCandidate.trim().substring(0, this.query.length); if(this.query.indexOf(valueToMatch) > -1){ showElement=true; }} else if(filterCandidate.indexOf(this.query) > -1){ showElement=true; } $(element).toggle(showElement) .toggleClass('multiselect-filter-hidden', !showElement); if($(element).hasClass('multiselect-group')){ currentGroup=element; currentGroupVisible=showElement; }else{ if(showElement){ $(currentGroup).show() .removeClass('multiselect-filter-hidden'); } if(!showElement&¤tGroupVisible){ $(element).show() .removeClass('multiselect-filter-hidden'); }} }}, this)); } this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); } this.options.onFiltering(event.target); }, this), 300, this); }, this)); }} }, destroy: function(){ this.$container.remove(); this.$select.show(); this.$select.prop('disabled', this.options.wasDisabled); this.$select.data('multiselect', null); }, refresh: function (){ var inputs=$.map($('li input', this.$ul), $); $('option', this.$select).each($.proxy(function (index, element){ var $elem=$(element); var value=$elem.val(); var $input; for (var i=inputs.length; 0 < i--; ){ if(value!==($input=inputs[i]).val()) continue; if($elem.is(':selected')){ $input.prop('checked', true); if(this.options.selectedClass){ $input.closest('li') .addClass(this.options.selectedClass); }}else{ $input.prop('checked', false); if(this.options.selectedClass){ $input.closest('li') .removeClass(this.options.selectedClass); }} if($elem.is(":disabled")){ $input.attr('disabled', 'disabled') .prop('disabled', true) .closest('li') .addClass('disabled'); }else{ $input.prop('disabled', false) .closest('li') .removeClass('disabled'); } break; }}, this)); this.updateButtonText(); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }}, select: function(selectValues, triggerOnChange){ if(!$.isArray(selectValues)){ selectValues=[selectValues]; } for (var i=0; i < selectValues.length; i++){ var value=selectValues[i]; if(value===null||value===undefined){ continue; } var $option=this.getOptionByValue(value); var $checkbox=this.getInputByValue(value); if($option===undefined||$checkbox===undefined){ continue; } if(!this.options.multiple){ this.deselectAll(false); } if(this.options.selectedClass){ $checkbox.closest('li') .addClass(this.options.selectedClass); } $checkbox.prop('checked', true); $option.prop('selected', true); if(triggerOnChange){ this.options.onChange($option, true); }} this.updateButtonText(); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }}, clearSelection: function (){ this.deselectAll(false); this.updateButtonText(); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }}, deselect: function(deselectValues, triggerOnChange){ if(!$.isArray(deselectValues)){ deselectValues=[deselectValues]; } for (var i=0; i < deselectValues.length; i++){ var value=deselectValues[i]; if(value===null||value===undefined){ continue; } var $option=this.getOptionByValue(value); var $checkbox=this.getInputByValue(value); if($option===undefined||$checkbox===undefined){ continue; } if(this.options.selectedClass){ $checkbox.closest('li') .removeClass(this.options.selectedClass); } $checkbox.prop('checked', false); $option.prop('selected', false); if(triggerOnChange){ this.options.onChange($option, false); }} this.updateButtonText(); this.updateSelectAll(); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); }}, selectAll: function (justVisible, triggerOnSelectAll){ var justVisible=typeof justVisible==='undefined' ? true:justVisible; var allLis=$("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul); var visibleLis=$("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible'); if(justVisible){ $('input:enabled' , visibleLis).prop('checked', true); visibleLis.addClass(this.options.selectedClass); $('input:enabled' , visibleLis).each($.proxy(function(index, element){ var value=$(element).val(); var option=this.getOptionByValue(value); $(option).prop('selected', true); }, this)); }else{ $('input:enabled' , allLis).prop('checked', true); allLis.addClass(this.options.selectedClass); $('input:enabled' , allLis).each($.proxy(function(index, element){ var value=$(element).val(); var option=this.getOptionByValue(value); $(option).prop('selected', true); }, this)); } $('li input[value="' + this.options.selectAllValue + '"]', this.$ul).prop('checked', true); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); } if(triggerOnSelectAll){ this.options.onSelectAll(); }}, deselectAll: function (justVisible, triggerOnDeselectAll){ var justVisible=typeof justVisible==='undefined' ? true:justVisible; var allLis=$("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul); var visibleLis=$("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible'); if(justVisible){ $('input[type="checkbox"]:enabled' , visibleLis).prop('checked', false); visibleLis.removeClass(this.options.selectedClass); $('input[type="checkbox"]:enabled' , visibleLis).each($.proxy(function(index, element){ var value=$(element).val(); var option=this.getOptionByValue(value); $(option).prop('selected', false); }, this)); }else{ $('input[type="checkbox"]:enabled' , allLis).prop('checked', false); allLis.removeClass(this.options.selectedClass); $('input[type="checkbox"]:enabled' , allLis).each($.proxy(function(index, element){ var value=$(element).val(); var option=this.getOptionByValue(value); $(option).prop('selected', false); }, this)); } $('li input[value="' + this.options.selectAllValue + '"]', this.$ul).prop('checked', false); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); } if(triggerOnDeselectAll){ this.options.onDeselectAll(); }}, rebuild: function(){ this.$ul.html(''); this.options.multiple=this.$select.attr('multiple')==="multiple"; this.buildSelectAll(); this.buildDropdownOptions(); this.buildFilter(); this.updateButtonText(); this.updateSelectAll(true); if(this.options.enableClickableOptGroups&&this.options.multiple){ this.updateOptGroups(); } if(this.options.disableIfEmpty&&$('option', this.$select).length <=0){ this.disable(); }else{ this.enable(); } if(this.options.dropRight){ this.$ul.addClass('pull-right'); }}, dataprovider: function(dataprovider){ var groupCounter=0; var $select=this.$select.empty(); $.each(dataprovider, function (index, option){ var $tag; if($.isArray(option.children)){ groupCounter++; $tag=$('').attr({ label: option.label||'Group ' + groupCounter, disabled: !!option.disabled }); forEach(option.children, function(subOption){ var attributes={ value: subOption.value, label: subOption.label||subOption.value, title: subOption.title, selected: !!subOption.selected, disabled: !!subOption.disabled }; for (var key in subOption.attributes){ attributes['data-' + key]=subOption.attributes[key]; } $tag.append($('